enhancement: Sign in with Google, on our existing Payload accounts
Back to our planType
enhancement
Problem
In plain words: neighbors can only sign in with an email and password. Many would rather tap "Continue with Google" and be in, with no new password to remember.
The owner's direction (recorded 2026-10-21 and 2026-11-11, Claude sessions): sign in with Google on our existing Payload accounts. Facebook, Apple and X are out; passkeys are their own epic (#313) and come after this. Signing in through Google does not establish residency (#314).
Proposed fix
Our own thin layer on a certified OAuth library, built in PR #505: GET /auth/google and /auth/google/callback, Google accounts created already verified as guest (not resident, which is for a verified neighbor: signing in with Google doesn't establish residency, per the owner's 2026-10-24 direction recorded here and #314), never linked to an existing account by email alone, and Payload's own session so /admin, sign-out and lockout keep working. The button shows only when the Google keys are set, so with no keys nothing changes for neighbors. Decision record 0020, in the PR (Proposed until the owner confirms the approach).
Remaining work on the PR: rebase onto current main, remove the Facebook provider and its settings and docs, take a free decision record number, and get a fresh independent review. It merges only after the Google app and keys exist (#312).
Existing work compared
Payload 3.91 has no native social sign-in and no official plugin. Four community plugins were read on #261 and rejected: some skip the state, nonce or verified-email checks, and the others replace Payload's own sign-in. Our own code around openid-client is about 250 lines, recorded in decision record 0020 on the PR. Searched open and closed issues for Google, OAuth and social sign-in: #261 (the evaluation), #312 (the owner's Google app), #908 (this epic).
Acceptance criteria
- Not done: "Continue with Google" appears on
/loginand/sign-uponly when the Google keys are set, and signs in or creates a verifiedguestaccount, never aresident. - Not done: A Google account never takes over an existing account by email; the person is told to sign in with their password.
- Not done: No Facebook provider, settings or docs remain.
- Not done: Without the keys, the site builds and the email path works as before.
- Not done: A Google sign-in on an empty database makes a
guest, never the first-account admin. - Not done: The accounts note,
docs/project.mdand the decision record describe it.
Files likely touched
src/modules/accounts/ (domain, data, use-cases, cms, ui), src/app/(frontend)/auth/[provider]/, src/app/(frontend)/login/ and sign-up/ pages, a migration for the googleSub field, package.json (openid-client), docs/architecture/decisions/, docs/project.md, docs/architecture/data-model.md, docs/guidelines/security.md, .env.local.example, e2e/serve.mjs.
Must not touch
Passkey code (#313); the neighborhood forum's own login (#553); residency (#314).
Open questions
None. The owner's Google app and keys (#312) are needed before it can merge.
Area
auth
Priority
priority: low
Generated by Claude Code, opens in a new tab