Skip to content

Commit d375e1d

Browse files
committed
Await on auth initialization before signing in with redirect.
1 parent a125713 commit d375e1d

File tree

1 file changed

+2
-0
lines changed
  • packages/auth/src/platform_browser/strategies

1 file changed

+2
-0
lines changed

packages/auth/src/platform_browser/strategies/redirect.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ export async function _signInWithRedirect(
9191
): Promise<void | never> {
9292
const authInternal = _castAuth(auth);
9393
_assertInstanceOf(auth, provider, FederatedAuthProvider);
94+
// Wait for auth initialization to complete, this will process pending redirects and clear session storage.
95+
await authInternal._initializationPromise;
9496
const resolverInternal = _withDefaultResolver(authInternal, resolver);
9597
await _setPendingRedirectStatus(resolverInternal, authInternal);
9698

0 commit comments

Comments
 (0)