fix: resolve GitHub OAuth login failures for non-owner users#154
Open
Gbangbolaoluwagbemiga wants to merge 1 commit into
Open
fix: resolve GitHub OAuth login failures for non-owner users#154Gbangbolaoluwagbemiga wants to merge 1 commit into
Gbangbolaoluwagbemiga wants to merge 1 commit into
Conversation
Backend handles the GitHub code exchange itself and requires the raw authorization code in the 'code' field, not a pre-exchanged access token. Removed the frontend token exchange step and simplified the callback route to pass the code directly to the backend along with the redirect_uri.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Invalid codeerrorsredirect_urialongside the code so the backend can complete the OAuth handshake correctlyRoot Cause
The previous implementation was exchanging the GitHub authorization code on the frontend first, then sending the resulting access token to the backend with key
access_token. The backend expected the raw auth code in acodefield and does its own exchange — sending a pre-exchanged token caused it to reject withInvalid code.Known Backend Issues (separate tickets needed)
The following backend bugs were discovered during testing and need to be fixed on the backend side:
emailfrom/userAPI. Users with private GitHub emails get401: Email is required. Backend needs to fall back to/user/emailsendpoint.first_nameandlast_namebut GitHub only provides an optional singlenamefield. Missing values cause500instead of graceful fallback to the GitHubloginusername.400 Bad Request.Test Plan
/auth/callbackwith code/hackathondashboardhttp://localhost:3000