M4-T08: add two-step login and TOTP settings panel (qrcode.react)

This commit is contained in:
2026-06-21 22:42:41 +02:00
parent 51da8c5716
commit ee1264b66b
10 changed files with 1405 additions and 51 deletions
+1 -1
View File
@@ -235,7 +235,7 @@ Phase BTOTP,可选配)
- **Reviewer checklist**: 逃生不依赖已存凭据;只动 auth 行。
### M4-T08 — 前端:两步登录 + 设置页 TOTP
- **Status**: `todo` · **Depends**: M4-T05, M4-T06
- **Status**: `done` · **Depends**: M4-T05, M4-T06
- **Files**: `modify frontend/src/pages/LoginPage.tsx``create frontend/src/pages/.../TotpSettings.tsx`(或并入 ConfigPage)、`frontend/src/auth/totp.ts``modify frontend/package.json`(+`qrcode.react`lock 同步)`create` 对应测试
- **Steps**: 登录页:401+`totp_required`→第二屏 6 位码(也接受恢复码);429→"稍后再试"(读 `Retry-After`)。设置页:未启用→启用流程(二维码由 `otpauth` URI 渲染 + 恢复码一次性展示 + 输码确认);已启用→停用。
- **Out of scope / 不要碰**: 不改后端;不碰防爆破逻辑。