按接码开关裁剪 OpenAI 手机验证节点
This commit is contained in:
@@ -3027,11 +3027,19 @@
|
||||
'paypal-hosted-review',
|
||||
'gopay-subscription-confirm',
|
||||
]);
|
||||
const POST_LOGIN_PHONE_VERIFICATION_STEP_KEYS = Object.freeze([
|
||||
'post-login-phone-verification',
|
||||
'post-bound-email-phone-verification',
|
||||
]);
|
||||
|
||||
function omitPlusPaymentChainSteps(steps = []) {
|
||||
return steps.filter((step) => !PLUS_PAYMENT_CHAIN_STEP_KEYS.includes(String(step?.key || '').trim()));
|
||||
}
|
||||
|
||||
function omitPostLoginPhoneVerificationSteps(steps = []) {
|
||||
return steps.filter((step) => !POST_LOGIN_PHONE_VERIFICATION_STEP_KEYS.includes(String(step?.key || '').trim()));
|
||||
}
|
||||
|
||||
function reindexModeStepDefinitions(steps = []) {
|
||||
return (Array.isArray(steps) ? steps : []).map((step, index) => ({
|
||||
...step,
|
||||
@@ -3116,6 +3124,13 @@
|
||||
return Boolean(options?.phoneSignupReloginAfterBindEmailEnabled);
|
||||
}
|
||||
|
||||
function isPhoneVerificationEnabled(options = {}) {
|
||||
if (Object.prototype.hasOwnProperty.call(options || {}, 'phoneVerificationEnabled')) {
|
||||
return Boolean(options.phoneVerificationEnabled);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function normalizePlusAccountAccessStrategy(value = '') {
|
||||
const normalized = String(value || '').trim().toLowerCase();
|
||||
if (normalized === PLUS_ACCOUNT_ACCESS_STRATEGY_SUB2API_CODEX_SESSION) {
|
||||
@@ -3206,6 +3221,9 @@
|
||||
) {
|
||||
steps = omitPlusPaymentChainSteps(steps);
|
||||
}
|
||||
if (!isPhoneVerificationEnabled(options)) {
|
||||
steps = omitPostLoginPhoneVerificationSteps(steps);
|
||||
}
|
||||
return reindexModeStepDefinitions(steps);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user