diff --git a/background.js b/background.js index 7297909..a07a4d9 100644 --- a/background.js +++ b/background.js @@ -151,7 +151,7 @@ const HUMAN_STEP_DELAY_MIN = 700; const HUMAN_STEP_DELAY_MAX = 2200; const STEP6_MAX_ATTEMPTS = 3; const STEP7_MAIL_POLLING_RECOVERY_MAX_ATTEMPTS = 8; -const OAUTH_FLOW_TIMEOUT_MS = 6 * 60 * 1000; +const OAUTH_FLOW_TIMEOUT_MS = 5 * 60 * 1000; const SUB2API_STEP1_RESPONSE_TIMEOUT_MS = 90000; const SUB2API_STEP9_RESPONSE_TIMEOUT_MS = 120000; const DEFAULT_SUB2API_URL = 'https://sub2api.hisence.fun/admin/accounts'; @@ -6836,7 +6836,7 @@ async function startOAuthFlowTimeoutWindow(options = {}) { oauthFlowDeadlineAt: deadlineAt, oauthFlowDeadlineSourceUrl: normalizeOAuthFlowSourceUrl(options.oauthUrl), }); - await addLog(`步骤 ${step}:已拿到新的 OAuth 登录地址,开始 6 分钟倒计时。`, 'info'); + await addLog(`步骤 ${step}:已拿到新的 OAuth 登录地址,开始 ${Math.round(OAUTH_FLOW_TIMEOUT_MS / 60000)} 分钟倒计时。`, 'info'); return deadlineAt; } diff --git a/tests/background-auth-chain-guard.test.js b/tests/background-auth-chain-guard.test.js index 3fec903..0353613 100644 --- a/tests/background-auth-chain-guard.test.js +++ b/tests/background-auth-chain-guard.test.js @@ -162,7 +162,7 @@ return { test('oauth timeout budget ignores stale deadlines from an old oauth url', async () => { const api = new Function(` const LOG_PREFIX = '[test]'; -const OAUTH_FLOW_TIMEOUT_MS = 6 * 60 * 1000; +const OAUTH_FLOW_TIMEOUT_MS = 5 * 60 * 1000; ${extractFunction('normalizeOAuthFlowDeadlineAt')} ${extractFunction('normalizeOAuthFlowSourceUrl')} ${extractFunction('getOAuthFlowRemainingMs')}