Auth0 React SDK: How to force SDK not to cache the user upon logout


I am trying out Auth0 React SDK for login to the SPA with Github only. I’m using the Universal Login method. I’m able to successfully log the user in and out with Github credentials.

When the user logs out, and attempts to login again, the Universal Login Dialog only shows “Sign In With Github” button. Which can log the previous user in. But what if I would like to change Github credentials and login as another user.

How can I force the SDK to not cache the previous user upon logout?

I might have made a progress, but it’s still not perfect.

I suppose I had to include ‘federated’ parameter to log out of Github altogether.

const logoutWithRedirect = () =>
      client_id: config.auth0.clientId,
      federated: true,
      returnTo: window.location.origin,

Now, I get prompted to logout from Github as well. However it does not redirect me to my app after logout. Instead I am returned to Github’s home page.

I see following URL parameters being sent to the /logout. and ‘window.location.origin’ is one of the Allowed URLs in Auth0 settings.

Any reason why the redirect doesn’t work?