feat(auth): include linked GitHub account id in OAuth id_token - #62
Open
mroderick wants to merge 1 commit into
Open
feat(auth): include linked GitHub account id in OAuth id_token#62mroderick wants to merge 1 commit into
mroderick wants to merge 1 commit into
Conversation
mroderick
force-pushed
the
feature/github-id-id-token
branch
from
August 11, 2026 08:40
df9a3ce to
83b6160
Compare
mroderick
marked this pull request as ready for review
August 11, 2026 08:45
| export async function getGithubAccountId(db, userId) { | ||
| const result = await db.query( | ||
| 'SELECT "accountId" FROM "account" WHERE "userId" = $1 AND "providerId" = $2 LIMIT 1', | ||
| [userId, "github"], |
Collaborator
There was a problem hiding this comment.
Would a fixed ‘github’ value inside the query be… clearer? As opposed to being a second arg?
Collaborator
There was a problem hiding this comment.
Agree, since this method is only for github
olleolleolle
approved these changes
Aug 11, 2026
olleolleolle
left a comment
Collaborator
There was a problem hiding this comment.
I think it looks lovely.
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
Related: codebar/planner#2805.
The planner now matches returning members by the stable GitHub account id when a user's GitHub email differs from their stored planner email (codebar/planner#2806). This change adds that
github_idclaim to the OAuthid_tokenso the planner can perform the lookup.Changes
src/auth/id-token-claims.jsto look up a user's linked GitHubaccountIdfrom the Better Authaccounttable.customIdTokenClaimson the OAuth provider to injectgithub_idinto theid_token.Deployment note
This should be deployed before or alongside codebar/planner#2806. When the claim is absent, the planner falls back to its existing email-based matching.
Post-Deploy Monitoring & Validation
getGithubAccountIdafter deploy.id_tokenissued for GitHub-linked users contains agithub_idclaim.