Fix dynamic auth tail node propagation
This commit is contained in:
@@ -212,7 +212,10 @@
|
||||
{
|
||||
type: 'SUBMIT_ADD_EMAIL',
|
||||
source: 'background',
|
||||
payload: { email: resolvedEmail },
|
||||
payload: {
|
||||
email: resolvedEmail,
|
||||
nodeId: state?.nodeId || activeFetchLoginCodeStepKey || 'fetch-login-code',
|
||||
},
|
||||
},
|
||||
{
|
||||
timeoutMs,
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
'signup-page',
|
||||
{
|
||||
type: 'EXECUTE_NODE',
|
||||
nodeId: 'oauth-login',
|
||||
nodeId: state?.nodeId || 'oauth-login',
|
||||
step: 7,
|
||||
source: 'background',
|
||||
payload: {
|
||||
|
||||
@@ -94,15 +94,15 @@
|
||||
}
|
||||
|
||||
const code = normalizeString(parsed.searchParams.get('code'));
|
||||
const state = normalizeString(parsed.searchParams.get('state'));
|
||||
if (!code || !state) {
|
||||
const oauthState = normalizeString(parsed.searchParams.get('state'));
|
||||
if (!code || !oauthState) {
|
||||
throw new Error(`步骤 ${platformVerifyStep} 捕获到的 localhost OAuth 回调地址缺少 code 或 state,请重新执行步骤 ${confirmOauthStep}。`);
|
||||
}
|
||||
|
||||
return {
|
||||
url: parsed.toString(),
|
||||
code,
|
||||
state,
|
||||
state: oauthState,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -503,15 +503,15 @@
|
||||
}
|
||||
|
||||
const code = normalizeString(parsed.searchParams.get('code'));
|
||||
const state = normalizeString(parsed.searchParams.get('state'));
|
||||
if (!code || !state) {
|
||||
const oauthState = normalizeString(parsed.searchParams.get('state'));
|
||||
if (!code || !oauthState) {
|
||||
throw new Error('回调 URL 中缺少 code 或 state。');
|
||||
}
|
||||
|
||||
return {
|
||||
url: parsed.toString(),
|
||||
code,
|
||||
state,
|
||||
state: oauthState,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1117,6 +1117,7 @@
|
||||
}
|
||||
|
||||
await chrome.tabs.update(signupTabId, { active: true });
|
||||
const completionNodeId = await getNodeIdForStep(completionStep);
|
||||
const baseResponseTimeoutMs = await getResponseTimeoutMsForStep(
|
||||
step,
|
||||
step === 8
|
||||
@@ -1134,6 +1135,7 @@
|
||||
source: 'background',
|
||||
payload: {
|
||||
code,
|
||||
...(completionNodeId ? { nodeId: completionNodeId } : {}),
|
||||
...(step === 4 && options.signupProfile ? { signupProfile: options.signupProfile } : {}),
|
||||
},
|
||||
};
|
||||
@@ -1268,6 +1270,7 @@
|
||||
async function resolveVerificationStep(step, state, mail, options = {}) {
|
||||
const completionStep = getCompletionStep(step, options);
|
||||
activeVerificationLogStep = completionStep;
|
||||
const completionNodeId = await getNodeIdForStep(completionStep);
|
||||
const stateKey = getVerificationCodeStateKey(step);
|
||||
const rejectedCodes = new Set();
|
||||
const hotmailPollConfig = mail.provider === HOTMAIL_PROVIDER
|
||||
@@ -1419,7 +1422,6 @@
|
||||
[stateKey]: result.code,
|
||||
});
|
||||
|
||||
const completionNodeId = await getNodeIdForStep(completionStep);
|
||||
if (!completionNodeId) {
|
||||
throw new Error(`步骤 ${completionStep} 未映射到验证码节点。`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user