Hi everyone,
I’m trying to get react to redirect to the original page after Auth0 sign on. I followed this tutorial (The Complete Guide to React User Authentication with Auth0) but have no luck even though it seemed to be what I needed. This is what I got so far:
const history = useNavigate();
const onRedirectCallback = (appState) => {
history.push(appState?.returnTo || window.location.pathname);
};
return (
<Auth0Provider
domain= { domain }
clientId= { clientId }
redirectUri={ window.location.origin }
onRedirectCallback={ onRedirectCallback }
>
{ children }
</Auth0Provider>
);
I thought the onRedirectCallback would solve the issue but it doesn’t. Also all the possible urls in the page are listed in the allowed Callback Url section.
Thanks for any help!