Skip to content

Commit

Permalink
fix: return early on success rehydrate
Browse files Browse the repository at this point in the history
  • Loading branch information
ieow committed Nov 5, 2024
1 parent 3ae70a6 commit 5696f42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mpcCoreKit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
// on failed redirect, instance is reseted.
// skip check feature gating on redirection as it was check before login
await this.handleRedirectResult();
// return after redirect, the rest of the code will not be executed

// return early on successful redirect, the rest of the code will not be executed
return;
} else if (params.rehydrate && this.sessionManager) {
// if not redirect flow try to rehydrate session if available
Expand All @@ -308,6 +309,9 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
// try rehydrate session
if (sessionResult) {
await this.rehydrateSession(sessionResult);

// return early on success rehydration
return;
}
}
}
Expand Down

0 comments on commit 5696f42

Please sign in to comment.