Account verification - #7418
Conversation
shortlight5980
commented
Jul 30, 2026
- 去除auth_code,增加tmp_datas的verification层包装,upsert和consume两个通用操作
- 微信扫码实现过期刷新(5min过期)
- 验证码校验1分钟10次限制
Coverage Report
File CoverageNo changed files found. |
|
✅ Admin Preview Image Ready! 🕒 Time: 2026-07-31 18:03:00 (UTC+8) |
|
✅ Build Successful - Preview fastgpt Image for this PR: 🕒 Time: 2026-07-31 18:06:08 (UTC+8) |
c811755 to
4f2c51a
Compare
c121914yu
left a comment
There was a problem hiding this comment.
Review result: no actionable findings in this PR after checking the tmp_datas verification wrapper, password pre-login flow, OAuth start/callback client wiring, WeChat QR expiry refresh, send-code caller migration, API schema/status handling, and tests. Note: the companion fastgpt-pro PR still has a blocking send-code type/purpose validation issue that should be fixed before the stack merges.
c121914yu
left a comment
There was a problem hiding this comment.
PR 审查报告
需求理解
本次改动把密码、验证码、微信和 OAuth 验证材料统一迁移到 tmp_datas,通过带过期条件的原子消费提高一次性验证安全性,并新增 OAuth 服务端事务、微信二维码过期刷新和验证码尝试频控。
逻辑验证
已走查密码登录成功/错误验证码、验证码第 11 次触发限流、OAuth 一次性 state、微信未扫码/过期刷新等主流程。目标测试共 62 个通过(Service 16、App 46)。另外使用 NEXT_PUBLIC_BASE_URL=/fastgpt 重跑 Pro OAuth flow,10 个用例中 5 个因 Invalid OAuth redirect URI 失败,复现了行评中的 basePath 回归。该 PR 当前 GitHub CI 全部通过。
问题统计
- 严重问题:2
- 建议改进:1
做得好的地方
consume 使用 findOneAndDelete 同时约束 expireAt 和材料内容,避免了先查后删的重复消费窗口;代理层也补了多 Set-Cookie 转发测试。
审查结论
需要修改。请先修复 basePath OAuth 和 auth_codes -> tmp_datas 的兼容发布问题;错误状态映射建议一并收紧。
|
执行: |