Repository navigation
fix(auth): recover duplicate desktop GitHub OAuth callbacks without replaying codes - #101
Draft
Aliferous3 wants to merge 1 commit into
Draft
Aliferous3 wants to merge 1 commit into
Aliferous3 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Aliferous3
force-pushed
the
fix/desktop-oauth-callback-replay
branch
from
November 1, 2026 09:09
91f8efb to
3d718aa
Compare
This branch was successfully deployed
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.
Production evidence
On 2026-11-01 at 08:57 UTC, the browser showed
GitHub token exchange failed. Vercel loggedbad_verification_codeat 08:57:46.901, yet Supabase shows an authenticated session at 08:57:46.303 and a desktop handoff code issued at 08:57:49.032, not consumed. This repeatedly points to overlapping/replayed callbacks using GitHub's single-use code; exact initiator of duplication is not yet known.Server-only recovery fix (no new installer or schema migration)
HMAC-SHA256(SESSION_SECRET, domain_separator || github_oauth_code || flow_uuid || desktop_PKCE_challenge). Only its SHA-256 hash is stored in the existingdesktop_auth_codestable. GitHub's original code and the server secret are never persisted or logged.bad_verification_code, check whether the first callback has actually issued the exact corresponding handoff. Bounded polling accommodates provisioning/insert latency; on match redirect to that same PKCE-bound deep link, rather than showing an OAuth error. Never mint a token, new session, or handoff from a failed exchange alone.Scope, safeguards and status
lib/desktop-auth.mjs,api/auth/callback.mjs, and their two test files.