Skip to content

Google sign-in: link only verified emails and claim unverified accounts - #24

Merged
qisthidev merged 1 commit into
mainfrom
k3/google-link-verified-only
Nov 7, 2026
Merged

qisthidev merged 1 commit into
mainfrom
k3/google-link-verified-only

Conversation

@qisthidev

@qisthidev qisthidev commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Approved by the maintainer (K3, 7 Nov).

AuthService::loginExternal():

  • If an account with the email exists and the provider did not report email_verified, sign-in is refused with "Sign in with your password to use this account". The Google callback shows that as a flash message on the login page.
  • If the account exists but was never verified locally (self-registration does not verify), the provider has just proven who owns the address. The account's password is replaced with an unusable one, its sessions are revoked, and it is marked verified, before the Google user is signed in.
  • Verified accounts are linked as before.

New UserRepository::markVerified().

Tests: no linking without provider verification; an unverified pre-registered account loses its old password and sessions. The existing "creates the account once" test now passes emailVerified: true on the second call, which is what Google sends.

Checked locally: npm run typecheck, npm test (39 pass).

🤖 Generated with Claude Code

https://claude.ai/code/session_016ZbncuXneGAhsgTaizfjVi

loginExternal() links an existing account only when the provider says
the email is verified. If the local account itself was never verified,
its password is replaced and its sessions revoked before the provider's
user signs in. The callback flashes a message when linking is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ZbncuXneGAhsgTaizfjVi
@qisthidev
qisthidev marked this pull request as ready for review November 7, 2026 04:54
@qisthidev
qisthidev merged commit 966d785 into main Nov 7, 2026
6 checks passed
@qisthidev
qisthidev deleted the k3/google-link-verified-only branch November 7, 2026 04:55
@qisthidev qisthidev mentioned this pull request Nov 7, 2026
qisthidev added a commit that referenced this pull request Nov 7, 2026
- package.json 0.6.1; volt-preline v0.3.1.
- docs/UPGRADING.md: what derived apps should port from #23, #24 and #25.


Claude-Session: https://claude.ai/code/session_016ZbncuXneGAhsgTaizfjVi

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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