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
+7
View File
@@ -874,6 +874,7 @@
onResendRequestedAt,
maxRounds: _ignoredMaxRounds,
maxResendRequests: _ignoredMaxResendRequests,
initialPollMaxAttempts: _ignoredInitialPollMaxAttempts,
...cleanPollOverrides
} = pollOverrides;
const basePayload = {
@@ -927,6 +928,7 @@
onResendRequestedAt,
maxRounds: _ignoredMaxRounds,
maxResendRequests: _ignoredMaxResendRequests,
initialPollMaxAttempts: _ignoredInitialPollMaxAttempts,
...cleanPollOverrides
} = pollOverrides;
@@ -982,6 +984,7 @@
let filterAfterTimestamp = cleanPollOverrides.filterAfterTimestamp ?? getVerificationPollPayload(step, state).filterAfterTimestamp;
const maxResendRequests = resolveMaxResendRequests(pollOverrides);
const maxRounds = maxResendRequests + 1;
const initialPollMaxAttempts = Math.max(0, Math.floor(Number(pollOverrides.initialPollMaxAttempts) || 0));
let usedResendRequests = 0;
for (let round = 1; round <= maxRounds; round++) {
@@ -1002,6 +1005,9 @@
filterAfterTimestamp,
excludeCodes: [...rejectedCodes],
});
if (round === 1 && initialPollMaxAttempts > 0) {
payload.maxAttempts = initialPollMaxAttempts;
}
try {
const timedPoll = await applyMailPollingTimeBudget(
@@ -1307,6 +1313,7 @@
disableTimeBudgetCap: Boolean(options.disableTimeBudgetCap),
getRemainingTimeMs: options.getRemainingTimeMs,
maxResendRequests: remainingAutomaticResendCount,
initialPollMaxAttempts: options.initialPollMaxAttempts,
resendIntervalMs,
lastResendAt,
onResendRequestedAt: updateFilterAfterTimestampForVerificationStep,