Skip to content

Commit

Permalink
Fix issue with verify email redirect using Auth0 (#1990)
Browse files Browse the repository at this point in the history
* fix: check for state with code

* Update packages/auth/src/authClients/auth0.ts

Co-authored-by: Peter Pistorius <[email protected]>
  • Loading branch information
o0charlie0o and peterp authored Mar 17, 2021
1 parent 31e3ac6 commit fd42de9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/auth/src/authClients/auth0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{},
Expand Down

0 comments on commit fd42de9

Please sign in to comment.