Secure admin login flow

This commit is contained in:
Codex
2026-04-28 09:16:15 +08:00
parent 21cb5c9c15
commit 98e32a4385
15 changed files with 646 additions and 0 deletions
+2
View File
@@ -47,6 +47,7 @@ Optional variables:
12. Run `npm run payload:migrate:status` and confirm every migration is `Yes`.
13. Start the app with `npm run start`.
14. Run `npm run smoke -- "$NEXT_PUBLIC_SITE_URL"`.
15. Log out of the admin, open `/admin/login`, and confirm the verification code is required before password validation.
## Data Rules
@@ -56,6 +57,7 @@ Optional variables:
- Do not edit migrations after they have shipped to production. Add a new forward migration instead.
- Keep schema migrations and data backfills separate. Backfill scripts in `src/scripts/` are manual operational tools, not automatic boot steps.
- The deployed database and upload directories must come from the same local export, otherwise media relationships can point at missing files.
- Admin login captcha is stateless and signed with `PAYLOAD_SECRET`; changing that secret invalidates existing login sessions and outstanding captcha tokens.
## Rollback