feat: 添加手机号认证失败处理逻辑,确保在遇到手机号页面时自动停止授权流程

This commit is contained in:
祁连海
2026-04-18 12:20:11 +08:00
parent 687bf7f71b
commit e22c36328b
10 changed files with 371 additions and 10 deletions
+4 -5
View File
@@ -9,6 +9,10 @@
getLoginAuthStateLabel,
getOAuthFlowStepTimeoutMs,
getState,
isAddPhoneAuthFailure = (error) => {
const message = String(typeof error === 'string' ? error : error?.message || '');
return /https:\/\/auth\.openai\.com\/add-phone(?:[/?#]|$)|\badd-phone\b|添加手机号|手机号码|手机号页|手机号页面|手机号|phone\s+number|telephone/i.test(message);
},
isStep6RecoverableResult,
isStep6SuccessResult,
refreshOAuthUrlBeforeStep6,
@@ -19,11 +23,6 @@
throwIfStopped,
} = deps;
function isAddPhoneAuthFailure(error) {
const message = String(typeof error === 'string' ? error : error?.message || '');
return /https:\/\/auth\.openai\.com\/add-phone(?:[/?#]|$)|add-phone|手机号页面|手机号码|手机号|phone\s+number|telephone/i.test(message);
}
async function executeStep7(state) {
if (!state.email) {
throw new Error('缺少邮箱地址,请先完成步骤 3。');