Skip to content

fix(aurora): 2FA login broken after rc.22 (send flow_token) - #68

Merged
Jaykebc1 merged 1 commit into
devfrom
fix/aurora-2fa-login-flow-token
Jul 29, 2026
Merged

fix(aurora): 2FA login broken after rc.22 (send flow_token)#68
Jaykebc1 merged 1 commit into
devfrom
fix/aurora-2fa-login-flow-token

Conversation

@Jaykebc1

Copy link
Copy Markdown
Collaborator

AI 辅助生成(Claude Code)。生产阻断修复——开启 2FA 的用户无法登录。

问题

dev 上开了 2FA 的账号登录时,2FA 步骤报「会话已过期,请重新登录」,登不进。

根因

rc.22 的 QuantumNous#6329 把服务端 2FA 登录 session 换成了无状态 AuthFlow token:密码步骤现在返回 data.flow_token,/api/user/login/2fa 要求请求体带 flow_token。aurora 前端仍按旧的 session 契约写、只发了 { code } → 后端 GetAuthFlow 查不到 → 会话已过期。

修复(纯前端)

  • 密码登录响应里接住 data.flow_token,跳转 OTP 前存入 sessionStorage
  • 2FA 验证时带上 flow_token(TOTP 和备用码同一 endpoint,一并修复);成功后清除
  • LoginResponse.data / TwoFAPayload 补类型

验证

aurora build + typecheck 通过(无新增错误)。

说明

passkey / OAuth 登录路径 rc.22 也可能有类似契约变化,本 PR 只修 TOTP/备用码登录(当前阻断项)。若 passkey 登录也异常再单独跟进。

Users with 2FA could not log in on dev: the 2FA step failed with
'session expired'. rc.22 (QuantumNous#6329) replaced the server-side 2FA login
session with a stateless AuthFlow token — the password step now returns
data.flow_token and /api/user/login/2fa requires it in the body. The
aurora frontend was still built for the old session-based flow and sent
only { code }, so the backend's GetAuthFlow lookup failed.

- Capture data.flow_token from the login response and stash it in
  sessionStorage before navigating to the OTP page.
- Send it back as flow_token on login2fa (covers both TOTP and backup
  code, same endpoint); clear it once verification succeeds.
- Type flow_token on LoginResponse.data and TwoFAPayload.

aurora build + typecheck clean (6 pre-existing warnings, no new).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant