Repository navigation
diagnostics(auth): investigate GitHub desktop code exchange rejections safely - #99
Draft
Aliferous3 wants to merge 7 commits into
Draft
Aliferous3 wants to merge 7 commits into
Aliferous3 wants to merge 7 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…llback attempts with keyed HMAC
…rding OAuth credentials
Aliferous3
force-pushed
the
fix/desktop-oauth-exchange-diagnostics
branch
from
November 1, 2026 09:09
b904564 to
b4fa062
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.
Evidence and scope
Production Vercel logs for the user's failed desktop login at 2026-10-31 23:38:37 UTC show GitHub returned
bad_verification_codeat/api/auth/callback(flow=desktop). This is before the desktop deep link or token storage. The exact cause of GitHub's rejection is not yet established; we should not claim this patch repairs desktop login.Changes
codeandstateare single string query parameters. Previously repeated codes were arrays, whichURLSearchParamswould silently serialize to a comma-joined, invalid code.bad_verification_codeexchange without leaking credentials.Diagnostic next step
If this recurs on a fresh OAuth attempt, inspect
oauth_age_secin production logs. A small age makes a stale 10-minute GitHub authorization less likely; then investigate code reuse/duplicate callbacks or provider-side issuance. No automatic retries: GitHub authorization codes are single-use.Do not merge without explicit approval
This is a controlled diagnostic PR, not an asserted root-cause fix. No installer rebuild required unless desktop-side code changes later.
November 1 investigation update
Production session+handoff records coincide with
bad_verification_codefailures, consistent with overlapping callbacks. Added a bounded SHA-256 fingerprint of high-entropy random OAuth state (not the raw state or authorization code) to accepted and rejected desktop token exchanges, plus elapsed time. This detects matching callback attempts without an optional correlation key, which is absent on this deployment. Unit tests model two callback requests with the same initial sealed cookie and prove the server currently accepts one and records GitHub's single-use rejection for the second. This PR is diagnostic only and does not claim to eliminate callback duplication.