feat(settings): regenerate 2FA recovery codes UI (BUNYIP-355 part 1) #355
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/BUNYIP-355-recovery-codes-ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part 1 of BUNYIP-355: surface the existing (but UI-less) recovery-code regeneration in the
/settings2FA card. Backend-only endpointPOST /auth/2fa/recovery-codesalready exists (password-gated, invalidates old codes, auditsTwoFactorRecoveryCodesRegenerated); this wires the front end.What's here
/settings/2fa/recovery-codesroute: GET renders a password-confirm form (mirroring the API's password gate); POST callsauth_api::regenerate_recovery_codesand shows the 8 new codes once, reusing the setup flow's codes panel. Errors re-render the form with the message.Tests
The codes-result view renders every code + the invalidation warning; the form surfaces an error only when one is passed.
Verification
just check-containergreen (fmt + clippy-D warnings+cargo test --workspace --all-targets; bunyip-web 91 tests incl. the 2 new). The live regen round trip runs on a dev stack.AC status
/settings2FA card exposes "Regenerate recovery codes" (2FA-enabled only); collects the password, invalidates the old codes, shows the 8 new codes once. (AC 1)Part 2 (follow-up)
The step-up-gated authenticator re-key: a staged pending secret (nullable
pending_*columns onuser_totp) so the active authenticator keeps working until the new one is confirmed, plusbegin_rekey/confirm_rekeyendpoints and the web UI. Speced on BUNYIP-355.#BUNYIP-355