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 fcfdee4 commit ddae1ff
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 @@ -301,7 +301,8 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
) {
// on failed redirect, instance is reseted.
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 @@ -317,6 +318,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 ddae1ff

Please sign in to comment.