2FA setup required: the window of existing accounts starts once, at the first start after the upgrade
Owner's decision: for accounts that exist before the upgrade the 72 hours count from the first start after it. The code already stamped them then; this adds the tests that the moment is written once per account (a restart, two instances starting at once, edits and logins do not move it; 71 h after it setup is open, 73 h after it the account is blocked) and says so in the docs. After the rebase on 1.16.5: tests that the setup-required notice and the stale import-map notice both stand above the screen and never replace the code form, and that requireSetup, safeBack and guard switch independently. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
5d44ac3135
commit
9d2ab43438
@@ -380,12 +380,14 @@ gets `403` from the same addresses and from `POST /api/setup-totp`. The Coolify
|
||||
strips `back`, can keep them (`twoFactor.safeBack: false` turns the plugin's check off).
|
||||
2. `pnpm ipal:skills`.
|
||||
|
||||
**→ the release after that — 2FA setup required (PROGRAMISTA §6, item 66; security.md "Setup required") — required
|
||||
**→ the release with `twoFactor.requireSetup` — 2FA setup required (CHANGELOG "Unreleased — 2FA setup required"; PROGRAMISTA §6, item 68; security.md "Setup required") — required
|
||||
with 2FA on:**
|
||||
1. **Before upgrading a live site:** `pnpm exec ipal-doctor --url <site>` (doctor token) → accounts without 2FA.
|
||||
Tell the owner: from the upgrade on, such an account can only set 2FA up, and has 72 hours for it; after that
|
||||
an administrator must reopen setup on the account's page. Have them set it up now, or remove unused accounts.
|
||||
Make sure at least one administrator has 2FA set up — otherwise nobody can reopen setup from the panel.
|
||||
The 72 hours of existing accounts start at the first start after the deploy and are counted once (restarts
|
||||
and redeploys do not extend them): agree the deploy day with the owner.
|
||||
2. Update the package, `pnpm install`, `pnpm ipal:skills`, `pnpm payload generate:types`,
|
||||
**`pnpm payload generate:importmap`** (new: `TwoFactorStatusField`, `TwoFactorAlert`; commit `importMap.js`).
|
||||
3. Postgres/SQLite: `pnpm payload migrate:create` (adds `totpSetupFrom` to the 2FA collection), commit. MongoDB: nothing.
|
||||
@@ -393,7 +395,9 @@ with 2FA on:**
|
||||
`twoFactor.requireSetup: { exempt: ({ user }) => user.email === '…' }`. `grep -rn "overrideAccess: false" src`:
|
||||
a `user` fetched by id is refused for every account now — take it from `payload.auth({ headers })`.
|
||||
5. `rm -rf .next`, build, redeploy on Coolify. Read the first lines of the log: `[ipal] 2FA: N existing account(s)
|
||||
without two-step verification…` — pass that number to the owner.
|
||||
without two-step verification…` — pass that number to the owner. The line appears on that first start only.
|
||||
Postgres/SQLite: the migration from step 3 must run in the same deploy; without it the log says
|
||||
`could not start the setup window` and the window starts at the first start that has it.
|
||||
**Check:** create a throwaway account → its token gets `403` from `/api/users/me`; in the panel it lands on the
|
||||
setup screen with "Set up two-step verification by …"; after the code it is in. As an administrator open that
|
||||
account → "Two-step verification: Set up." and the reset button; delete the account.
|
||||
|
||||
Reference in New Issue
Block a user