feat: 更新验证页面逻辑,确保密码重试页面不被视为验证页面,并添加相关测试

This commit is contained in:
QLHazyCoder
2026-04-18 00:29:20 +08:00
parent 14a3e9d6b2
commit 466011d4e5
2 changed files with 153 additions and 4 deletions
+11 -4
View File
@@ -752,10 +752,17 @@ function isOAuthConsentPage() {
}
function isVerificationPageStillVisible() {
if (getCurrentAuthRetryPageState('signup_password') || getCurrentAuthRetryPageState('login')) {
return false;
}
if (getVerificationCodeTarget()) return true;
if (findResendVerificationCodeTrigger({ allowDisabled: true })) return true;
if (document.querySelector('form[action*="email-verification" i]')) return true;
if (!isEmailVerificationPage()) {
return false;
}
return VERIFICATION_PAGE_PATTERN.test(getPageTextSnapshot());
}
@@ -1314,10 +1321,6 @@ function inspectSignupVerificationState() {
return { state: 'step5' };
}
if (isVerificationPageStillVisible()) {
return { state: 'verification' };
}
if (isSignupPasswordErrorPage()) {
const timeoutPage = getSignupPasswordTimeoutErrorPageState();
return {
@@ -1326,6 +1329,10 @@ function inspectSignupVerificationState() {
};
}
if (isVerificationPageStillVisible()) {
return { state: 'verification' };
}
if (isSignupEmailAlreadyExistsPage()) {
return { state: 'email_exists' };
}