Repository navigation
fix(auth): request Google email scope (fixes "Google email not verified") - #104
Merged
Merged
Conversation
… claim Enoki's createAuthorizationURL defaults the OAuth scope to "openid" only, and Google emits `email`/`email_verified` claims only when the `email` scope is requested. Without it the bind-google route saw no email claim and rejected sign-in with the misleading "Google email not verified" (#96). Add `extraParams: { scope: ["email"] }`. Scope doesn't affect zkLogin address derivation (iss/aud/sub), so existing Google users are unaffected; `email` is non-sensitive (no Google re-review). Adds a regression test pinning the scope. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
The fix that missed the #103 merge window (that PR was merged at the deploy-roll commit, before this was pushed). Prod still shows "Google email not verified" until this merges + redeploys.
Root cause
Enoki's
createAuthorizationURLdefaults the OAuth scope toopenidonly. Google includesemail/email_verifiedclaims only when theemailscope is requested, sobind-google/route.tssaw no email claim and rejected with the misleading "Google email not verified".Fix
lib/auth.ts— addextraParams: { scope: ["email"] }.emailis a non-sensitive Google scope → no OAuth re-review.Verification
bunx tsc --noEmitclean · new test fails-before / passes-after · full suite 197/197.After deploy
Only affects new sign-ins. An already-logged-in Google session has a cached
openid-only JWT, so Retry reuses it and still fails — sign out and sign in again to mint a token with theemailscope.🤖 Generated with Claude Code