Hi @roamingstars,
Welcome back to the Auth0 Community!
The reason the user is being logged out after a page refresh when using the React SDK might be the lack of implementing the onRedirectCallback function found on the Auth0 Provider, which removes the state and code parameters from the URL after being redirected from the authorize page so that the Callback URL is stil valid.
This is a code snippet of implementing it:
const onRedirectCallback = (appState) => {
history.push(
appState && appState.returnTo ? appState.returnTo : window.location.pathname
);
};
referenced in the State and Code Parameters Stuck in URL react-auth0 - User Getting Logged Out on Page Refresh article.
I hope this helps!
Best regards,
Remus