feat: 更新验证页面逻辑,确保密码重试页面不被视为验证页面,并添加相关测试
This commit is contained in:
+11
-4
@@ -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' };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user