M1 (7): a password rule for staff accounts (accounts.password)

When a password is set on a staff collection — a new account, the first-user
screen, a change, a reset by e-mail; panel, API and Local API alike — it must
have at least 12 characters and not be the account's own e-mail address.
Existing passwords are never checked: a shorter one keeps logging in and meets
the rule when it is next changed. accounts.password: { minLength } | false.
No breached-password lookup; checkPassword and the hook are exported.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 00:39:12 +01:00
co-authored by Claude Fable 5.2
parent c6fc0d21fe
commit 5d35b2c3f4
8 changed files with 204 additions and 15 deletions
+5 -5
View File
@@ -34,16 +34,16 @@ import type { StatsOptions } from './modules/stats/collection.js'
* Passed by the client project in payload.config.ts.
*/
export type IpalOptions = {
/**
* Rules for the accounts of the staff collection: who may open the panel
* (`panelRole`). `false` = none of them. docs/access.md "Account rules".
*/
accounts?: AccountsOptions | false
/**
* Role-based access control. Injects a fixed `roles` field
* (admin > editor > user) into the client's auth collection.
*/
access?: AccessOption
/**
* Rules for the accounts of the staff collection: who may open the panel
* (`panelRole`). `false` = none of them. docs/access.md "Account rules".
*/
accounts?: AccountsOptions | false
/**
* Admin panel <head> for link previews and search engines (default on):