From fd42de98445a3fc07ee74cc544f4f13842ebc35a Mon Sep 17 00:00:00 2001 From: Charlie Ray Date: Wed, 17 Mar 2021 03:05:14 -0500 Subject: [PATCH] Fix issue with verify email redirect using Auth0 (#1990) * fix: check for state with code * Update packages/auth/src/authClients/auth0.ts Co-authored-by: Peter Pistorius --- packages/auth/src/authClients/auth0.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/auth/src/authClients/auth0.ts b/packages/auth/src/authClients/auth0.ts index 10a196bb0531..3fb16e1622d4 100644 --- a/packages/auth/src/authClients/auth0.ts +++ b/packages/auth/src/authClients/auth0.ts @@ -14,7 +14,10 @@ export const auth0 = (client: Auth0): AuthClientAuth0 => { type: 'auth0', client, restoreAuthState: async () => { - if (window?.location?.search?.includes('code=')) { + if ( + global?.location?.search?.includes('code=') && + global?.location?.search?.includes('state=') + ) { const { appState } = await client.handleRedirectCallback() window.history.replaceState( {},