Skip to content
SprecherEast
Issue 269

enhancement: Sign in with Payload's helper and add forgot/reset password pages on Payload's built-ins

Back to our plan
Done
enhancementauthpriority: high

Problem

Signing in copies Payload's own helper: startSession in src/modules/accounts/data/session.ts and data/cookies.ts do what login from @payloadcms/next/auth does (server functions, opens in a new tab). Residents also have no page to reset a forgotten password; only /admin/reset exists.

Proposed fix

  • Sign in through @payloadcms/next/auth's login. Keep endSession (Payload 3.91's logout can delete the admin's payload-theme cookie), the change-password flow and the requireCurrentPassword hook (site policy).
  • Add a "Forgot your password?" page and a reset page as thin forms over Payload's forgotPassword and resetPassword operations (token, expiry and resend limit are built in).

Findings (#262): native covers both; no plugin or custom tokens needed.

Blocked by #266: if the owner picks Better Auth, sign-in and reset move there instead.

Acceptance criteria

  • Not done: startSession and data/cookies.ts are replaced by Payload's helper
  • Not done: A resident can request a reset link from the sign-in page and set a new password
  • Not done: Error messages stay generic (no account enumeration)

Area

auth

Priority

High


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab