fix(auth): preserve phone login identity across step8 retries

This commit is contained in:
InkCrow
2026-05-12 16:41:09 +08:00
parent ff38933ce4
commit 1ed128e118
7 changed files with 127 additions and 19 deletions
+14 -4
View File
@@ -31,6 +31,7 @@
reuseOrCreateTab,
sendToContentScriptResilient,
buildRegistrationEmailStateUpdates = null,
persistRegistrationEmailState = null,
phoneVerificationHelpers = null,
setState,
shouldUseCustomRegistrationEmail,
@@ -181,10 +182,17 @@
}
const displayedEmail = normalizeStep8VerificationTargetEmail(result?.displayedEmail || resolvedEmail);
await setState({
email: resolvedEmail,
step8VerificationTargetEmail: displayedEmail,
});
if (typeof persistRegistrationEmailState === 'function') {
await persistRegistrationEmailState(latestState, resolvedEmail, {
source: 'step8_add_email',
preserveAccountIdentity: true,
});
} else {
await setState({
email: resolvedEmail,
step8VerificationTargetEmail: displayedEmail,
});
}
return {
state: {
@@ -535,6 +543,8 @@
}
},
targetEmail: fixedTargetEmail,
maxResendRequests: mail.provider === '2925' ? 1 : undefined,
initialPollMaxAttempts: mail.provider === '2925' ? 5 : undefined,
resendIntervalMs: mail.provider === LUCKMAIL_PROVIDER
? 15000
: ((mail.provider === HOTMAIL_PROVIDER || mail.provider === '2925')