修复身份验证输错短信验证码时显示"独立密码不正确"
CODE_INVALID 这个reason同时被独立密码校验和短信验证码校验两个不相关 接口复用,错误文案只写了前者的措辞,在身份验证页答非所问。改成对两 种场景都准确的通用措辞。 第十一轮最小粒度测试 Ch10-11 发现。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
fc757cc043
commit
117bf43c25
+10
-4
@@ -76,10 +76,16 @@ const REASON_MESSAGES = {
|
||||
YOUTH_MODE_RESTRICTED: '青少年模式下无法使用此功能',
|
||||
RISK_CONFIRMATION_REQUIRED: '需要先完成安全确认',
|
||||
RISK_ACTION_BLOCKED: '该操作已被安全策略拦截',
|
||||
// 独立密码校验的两个 reason(对接文档 809 行有写),青少年模式关闭/开启走的都是这条接口。
|
||||
// 原来没收录,报错时直接透传后端英文原文——PIN 输错显示 "code invalid",连续错误锁定后
|
||||
// 显示 "too many attempts",且不告诉用户要等多久能重试。
|
||||
CODE_INVALID: '独立密码不正确',
|
||||
// CODE_INVALID is shared by two unrelated verify endpoints -- independent-password PIN check
|
||||
// (青少年模式关闭/开启走的这条接口,对接文档 809 行) *and* the plain SMS verification-code
|
||||
// verify endpoints (/auth/verification-codes/{id}/verify, /security/challenges/{id}/verify --
|
||||
// confirmed live: entering a wrong SMS code on the "忘记独立密码?" identity-check screen also
|
||||
// gets back reason=CODE_INVALID). This table only keys off the reason string with no per-call-site
|
||||
// override, so a message written for just one of the two ("独立密码不正确") showed up verbatim on
|
||||
// the *other* endpoint's screen, where there's no "独立密码" concept in view at all -- confusing,
|
||||
// wrong-sounding copy for a real, correctly-rejected wrong code. Kept generic enough to be accurate
|
||||
// for both rather than wrong in either.
|
||||
CODE_INVALID: '验证码或独立密码不正确',
|
||||
TOO_MANY_ATTEMPTS: details => details && details.retry_after_seconds
|
||||
? `连续输错次数过多,请 ${details.retry_after_seconds} 秒后重试`
|
||||
: '连续输错次数过多,请稍后重试'
|
||||
|
||||
Reference in New Issue
Block a user