How to check if user has logged out in another tab?

It looks like if you set the cacheLocation on the Auth0Provider to ‘localstorage’ other tabs will be able to pick up that the user has logged out.

ReactDOM.render(
  <Auth0Provider
    domain={config.domain}
    clientId={config.clientId}
    audience={config.audience}
    redirectUri={window.location.origin}
    onRedirectCallback={onRedirectCallback}
    useRefreshTokens={true}
    cacheLocation="localstorage"
  >
    <App />
  </Auth0Provider>,
  document.getElementById("root")
);

Note about local storage from this topic:

1 Like