Skip to content

fix(auth): request Google email scope (fixes "Google email not verified") - #104

Merged
dadadave80 merged 1 commit into
mainfrom
fix/google-email-scope
Jun 21, 2026
Merged

dadadave80 merged 1 commit into
mainfrom
fix/google-email-scope

Conversation

@dadadave80

Copy link
Copy Markdown
Member

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 createAuthorizationURL defaults the OAuth scope to openid only. Google includes email/email_verified claims only when the email scope is requested, so bind-google/route.ts saw no email claim and rejected with the misleading "Google email not verified".

Fix

lib/auth.ts — add extraParams: { scope: ["email"] }.

  • Doesn't change the zkLogin address (derived from iss/aud/sub) → existing Google users unaffected.
  • email is a non-sensitive Google scope → no OAuth re-review.
  • Adds a regression test pinning the scope at the call site.

Verification

bunx tsc --noEmit clean · 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 the email scope.

🤖 Generated with Claude Code

… 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>
@vercel

vercel Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hostit-sui Ready Ready Preview, Comment Jun 21, 2026 8:41pm

@dadadave80
dadadave80 merged commit e3387df into main Jun 21, 2026
7 checks passed
@dadadave80
dadadave80 deleted the fix/google-email-scope branch June 21, 2026 20:43

This branch was successfully deployed

1 active deployment
Preview — df87ab8d Deployed Jun 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant