[Fix] Linear session resumes with the wrong authorized account - #889
Merged
Conversation
Contributor
Author
|
No new code issues found. See task
Reviewed 0296736 |
Contributor
Author
mrubens
marked this pull request as ready for review
July 29, 2026 18:58
mrubens
requested review from
brunobergher,
daniel-lxs and
mrubens
as code owners
July 29, 2026 18:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Linear OAuth replays now require the authorized viewer's user ID and organization ID to match the identity saved with the original session. Successful authorization stores identity metadata and OAuth tokens together in one connection update.
Replay setup no longer clears an existing Linear connection, and a mismatch leaves its metadata, tokens, enabled state, and authentication status unchanged while keeping the replay unconsumed.
Focused coverage verifies both user and organization mismatches, as well as callback token-storage ordering.
Why this change was made
The replay flow previously accepted any Linear viewer and organization, which could link a different Linear account and start the original session under an identity that had not initiated it. This addresses the identity-binding issue reported in PR #887.
Impact
Users must authorize the same Linear account and organization that initiated a replayed session. Incorrect account selection now fails safely without replacing or disconnecting an existing Linear link, while successful authorization cannot leave mixed token and identity state.