diff --git a/src/mpcCoreKit.ts b/src/mpcCoreKit.ts index 3043df4e..ad2650fa 100644 --- a/src/mpcCoreKit.ts +++ b/src/mpcCoreKit.ts @@ -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 @@ -308,6 +309,9 @@ export class Web3AuthMPCCoreKit implements ICoreKit { // try rehydrate session if (sessionResult) { await this.rehydrateSession(sessionResult); + + // return early on success rehydration + return; } } }