fix: recover add-phone flow from auth error pages

This commit is contained in:
root
2026-05-09 03:55:45 -04:00
parent 6f67a00980
commit a8e77396e1
3 changed files with 382 additions and 22 deletions
+22
View File
@@ -10802,6 +10802,28 @@ const phoneVerificationHelpers = self.MultiPageBackgroundPhoneVerification?.crea
DEFAULT_PHONE_CODE_POLL_INTERVAL_SECONDS,
DEFAULT_PHONE_CODE_POLL_ROUNDS,
ensureStep8SignupPageReady,
navigateAuthTabToAddPhone: async (tabId, options = {}) => {
const visibleStep = Math.floor(Number(options.visibleStep || options.step) || 0) || 9;
const requestedTimeoutMs = Number(options.timeoutMs);
const timeoutMs = Number.isFinite(requestedTimeoutMs) && requestedTimeoutMs > 0
? requestedTimeoutMs
: await getOAuthFlowStepTimeoutMs(30000, {
step: visibleStep,
actionLabel: 'direct add-phone navigation',
});
await chrome.tabs.update(tabId, { url: 'https://auth.openai.com/add-phone', active: true });
await ensureStep8SignupPageReady(tabId, {
timeoutMs,
visibleStep,
logStepKey: options.logStepKey || 'phone-verification',
logMessage: options.logMessage || '步骤 9:认证页已失联,直接打开添加手机号页面后等待脚本恢复。',
});
return {
addPhonePage: true,
phoneVerificationPage: false,
url: 'https://auth.openai.com/add-phone',
};
},
generateRandomBirthday,
generateRandomName,
getOAuthFlowRemainingMs,