Skip to content
SprecherEast
Issue 187

enhancement: Resident sign-up on Payload's native auth (create + verify), offered after email confirmation

Back to our plan
Done
enhancementauthuxpriority: high

Type

enhancement

Decision (owner, 2026-10-23)

Summary of the owner's decision (2026-10-23, Claude chat session):

Account confirmation (#187): option A is approved. Verification uses Payload's own native flow, and a second confirmation click is acceptable, because he prefers secure, simple and maintainable over unneeded custom code. Account creation begins only when the visitor explicitly chooses Yes, and choosing No leaves them without an account. The resident role stays restricted, and password-reset emails to unverified accounts stay blocked.

Earlier decisions this builds on: an account is offered, not imposed, read-only to start (2026-10-21, quoted on #168); accounts use Payload's own sign-in (2026-10-23, #266).

What to build (native first, #262)

  • The offer: after a contact sender confirms their email (#183's confirm page), ask "Create a free Sprecher East account?" with Yes and No.
  • Yes opens the sign-up page with the email filled in. Nothing is created until the visitor submits that form. No creates nothing and sends nothing; the email stays confirmed as before.
  • Sign-up: a thin form over Payload's create on users, run by the accounts module's server action (Local API) with the role forced to resident. The REST create stays admin-only.
  • Verification: Payload's native auth.verify on users, with the email branded through generateEmailSubject / generateEmailHTML and linking to a site verify page. This is the second confirmation click, by design. Payload's lockout of unverified sign-ins applies.
  • Verify page: a thin page over Payload's verify operation, then the person signs in.
  • No reset email to an unverified account: Payload 3.91's forgot password doesn't check _verified, so a hook stops it for unverified accounts, with the same generic answer and a test.
  • Existing accounts (admins, editors, residents) are marked verified in the migration, so turning on auth.verify locks nobody out.
  • Later, by the same flow: a confirmed contact sender who said No can still sign up; Payload's verify link is the "one click on a link sent to that inbox" accepted on 2026-10-21. No custom tokens.

Acceptance criteria

  • Not done: After confirming, a contact sender is asked Yes or No. Only Yes leads to sign-up, and only submitting the sign-up form creates an account.
  • Not done: No creates no account and sends no email.
  • Not done: Sign-up always produces the resident role; a test fails if it can produce any other role, and resident can't open /admin or create content.
  • Not done: A new account can't sign in until its email is verified through Payload's link; the link works once.
  • Not done: Forgot password sends nothing to an unverified account, with the same generic answer; tested.
  • Not done: Existing accounts still sign in after the migration.
  • Not done: Every response is the same generic message whether or not an address has an account (docs/guidelines/security.md).
  • Not done: Findings per native-first step are recorded here before any custom code.

Area

auth, ux

Priority

priority: high


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab