2FA setup required: an account without TOTP reaches only setup, within a 72 h window
twoFactor.requireSetup (on by default with 2FA): an account of the 2FA collection that has not set TOTP up is refused by ipal-kit's second-factor check on every collection, global and plugin endpoint; the setup screen and /api/setup-totp are all it reaches. It has 72 hours from its creation or from an admin's reset (field totpSetupFrom, stamped by a hook); after that setup is refused too until an admin reopens it. Accounts that existed before get their window at the first start after the upgrade (backfill in onInit), so nobody is blocked when a site upgrades. Admin side: status and reset / 'Reopen setup' button on the account page (TwoFactorStatusField), POST /api/ipal/two-factor/reset, a dashboard notice (TwoFactorAlert), a notice on the setup screen; texts in English and Polish. ipal-doctor reports blocked accounts and a switched-off mode. Overridable: requireSetup false, windowHours (false / 0 = none), exempt for a service account, resetAccess; the per-entity second-factor opt-out applies. API keys, seeds, bearer-token routes and sites with twoFactor false are not affected. HTTP tests (REST, GraphQL, first admin on an empty database) run on SQLite, Postgres and MongoDB; a browser test on the reference site covers the first admin, a new editor and the admin's reset. Docs, guide, skills, changelog. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
45d52c4690
commit
2aaaaa115a
@@ -1292,6 +1292,7 @@ export interface User {
|
||||
id: string;
|
||||
totpSecret?: string | null;
|
||||
hasTotp?: boolean | null;
|
||||
totpSetupFrom?: string | null;
|
||||
/**
|
||||
* Administrators manage everything; editors manage content.
|
||||
*/
|
||||
@@ -2076,6 +2077,7 @@ export interface MediaSelect<T extends boolean = true> {
|
||||
export interface UsersSelect<T extends boolean = true> {
|
||||
totpSecret?: T;
|
||||
hasTotp?: T;
|
||||
totpSetupFrom?: T;
|
||||
roles?: T;
|
||||
updatedAt?: T;
|
||||
createdAt?: T;
|
||||
|
||||
Reference in New Issue
Block a user