fix(auth): add submit Turnstile widget in email verify flow

- 邮箱验证码流程中,提交注册前要求重新完成 Turnstile 验证
- 修复发送验证码后 token 被清空导致注册时缺少 turnstile_token 的问题
- submit/resend 两个 widget 通过 showResendTurnstile 互斥显示
This commit is contained in:
erio
2026-03-01 13:02:12 +08:00
parent 99663a3f20
commit 51e7f262bd
2 changed files with 44 additions and 5 deletions

View File

@@ -113,8 +113,7 @@ func (h *AuthHandler) Register(c *gin.Context) {
return
}
// Turnstile 验证 — 始终执行,防止绕过
// TODO: 确认前端在提交邮箱验证码注册时也传递了 turnstile_token
// Turnstile 验证 — 始终执行,防止机器人自动化注册
if err := h.authService.VerifyTurnstile(c.Request.Context(), req.TurnstileToken, ip.GetClientIP(c)); err != nil {
response.ErrorFrom(c, err)
return