Skip to content

stop login callback re-redeeming the oauth code on reload#1943

Open
efstajas wants to merge 2 commits into
mainfrom
fix-login-callback-double-redeem
Open

stop login callback re-redeeming the oauth code on reload#1943
efstajas wants to merge 2 commits into
mainfrom
fix-login-callback-double-redeem

Conversation

@efstajas

Copy link
Copy Markdown
Contributor

the redeem takes ~1.5s (github exchange), which on slow connections invites a reload mid-flight. the reloaded callback page then re-posted the same single-use code, got "OAuth session already used" back, and showed the generic error screen — even when the first attempt had succeeded server-side with its response lost.

mark the code as attempted in sessionStorage before redeeming; a later load seeing the marker skips straight to the login page (which bounces to backTo if a session exists, and re-authorizes instantly otherwise). also surface the backend's actual error message instead of blaming github for everything, and carry backTo through the try-again button.

the redeem takes ~1.5s (github exchange), which on slow connections invites
a reload mid-flight. the reloaded callback page then re-posted the same
single-use code, got "OAuth session already used" back, and showed the
generic error screen — even when the first attempt had succeeded server-side
with its response lost.

mark the code as attempted in sessionStorage before redeeming; a later load
seeing the marker skips straight to the login page (which bounces to backTo
if a session exists, and re-authorizes instantly otherwise). also surface
the backend's actual error message instead of blaming github for
everything, and carry backTo through the try-again button.
Copilot AI review requested due to automatic review settings July 21, 2026 15:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 21, 2026 15:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants