···
250
-
// If verification succeeds, continue to data migration
251
-
await startDataMigration();
250
+
// verifyStep will handle continuing to the next step via continueToNextStep
251
+
// No need to call startDataMigration here
···
throw new Error("Invalid response from server");
301
+
// Verify the identity migration succeeded
updateStepStatus(2, "verifying");
302
-
const verified = await verifyStep(2);
303
+
const verified = await verifyStep(2, true); // Pass true to allow verification for manual submission
305
-
"Identity migration: Verification failed, waiting for user action",
306
+
"Identity migration: Verification failed after token submission",
310
-
// If verification succeeds, continue to finalization
311
+
// If verification succeeds, mark as completed and continue
312
+
updateStepStatus(2, "completed");
await startFinalization();
console.error("Identity migration error:", error);
···
// Helper to verify a step after completion
399
-
const verifyStep = async (stepNum: number) => {
401
+
const verifyStep = async (stepNum: number, isManualSubmission: boolean = false) => {
console.log(`Verification: Starting step ${stepNum + 1}`);
404
+
// Skip automatic verification for step 2 (identity migration) unless it's after manual token submission
405
+
if (stepNum === 2 && !isManualSubmission) {
406
+
console.log(`Verification: Skipping automatic verification for identity migration step`);
updateStepStatus(stepNum, "verifying");
console.log(`Verification: Fetching status for step ${stepNum + 1}`);
···
const retryVerification = async (stepNum: number) => {
console.log(`Retrying verification for step ${stepNum + 1}`);
484
-
await verifyStep(stepNum);
493
+
// For identity migration step, pass true if it's after manual submission
494
+
const isManualSubmission = stepNum === 2 && steps[2].name === "Enter the token sent to your email to complete identity migration";
495
+
await verifyStep(stepNum, isManualSubmission);
const continueAnyway = (stepNum: number) => {
···
604
-
// If verification succeeds, continue to next step
605
-
await startIdentityMigration();
615
+
// verifyStep will handle continuing to the next step via continueToNextStep
616
+
// No need to call startIdentityMigration here
console.error("Data migration: Error caught:", error);
···
const startIdentityMigration = async () => {
// Step 3: Request Identity Migration
630
+
// Check if already in progress to prevent duplicate calls
631
+
if (steps[2].status === "in-progress" || steps[2].status === "completed") {
632
+
console.log("Identity migration already in progress or completed, skipping duplicate call");
updateStepStatus(2, "in-progress");
console.log("Requesting identity migration...");
···
666
-
// Don't continue with migration - wait for token input
683
+
// Don't verify or continue - wait for token input
684
+
// Skip automatic verification for identity migration step
685
+
console.log("Identity migration: Waiting for user token input, skipping auto-verification");
console.error("Failed to parse identity request response:", e);