Hi,
We are facing an intermittent issue of Invalid State, sometimes for certain users. This is sometimes hard to reproduce.
This is the app setup we are using auth0-react 1.5.0
I am seeing an intermittent issue of “Invalid-State” with my Next’s Static Apps which uses auth0-react-sdk.
This is my setup
const onRedirectCallback = appState => {
console.log('OnRedirectCallback() => ', {appState})
Router.replace(appState?.returnTo || `${window.location.origin}${TESTINDEX}`)
}
function MyApp({Component, pageProps}) {
return (
<Auth0Provider
domain={process.env.NEXT_PUBLIC_AUTH0_DOMAIN}
clientId={process.env.NEXT_PUBLIC_CLIENT_ID}
audience={process.env.NEXT_PUBLIC_AUTH0_AUDIENCE}
redirectUri={
typeof window !== 'undefined' && `${window.location.origin}${TESTINDEX}`
}
onRedirectCallback={onRedirectCallback}
useRefreshTokens
>
<Head>
<meta name="viewport" content="width=device-width" />
<meta charSet="utf-8" />
<link rel="icon" type="image/png" href="/images/favicon.ico" />
</Head>
<Component {...pageProps} />
</Auth0Provider>
)
}
Please suggest what needs to be done to avoid this issue