You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When switching between different auth0 users within the same browser, the user from useAuth0() will return undefined and the isAuthenticated will return false, even after the user has successfully authenticated with the loginWithRedirect function. This occurs when using the cacheLocation is set to memory
Reproduction
Setup an auth0 provider with cacheLocation='memory' useRefreshTokens={true} and useRefreshTokensFallback={true}
Use a chrome or microsoft edge browser and authenticate a user and switch between several auth0 accounts.
You should notice that after proceeding through the loginWithRedirect and being directed to the client application that intermittently, the user will still be undefined and the isAuthenticated will be false.
Additional context
No response
auth0-react version
2.2.0
React version
18.3.1
Which browsers have you tested in?
Chrome, Edge
The text was updated successfully, but these errors were encountered:
Can you confirm if this issue occurs only when switching between different users? Additionally, could you share how the onRedirectCallback is being handled in your application?
Just a quick note: if cacheLocation is set to memory, the user information will not persist after a page reload. However, I understand that your use case might differ in this scenario.
Checklist
Description
When switching between different auth0 users within the same browser, the
user
from useAuth0() will return undefined and theisAuthenticated
will return false, even after the user has successfully authenticated with theloginWithRedirect
function. This occurs when using the cacheLocation is set to memoryReproduction
user
will still be undefined and theisAuthenticated
will be false.Additional context
No response
auth0-react version
2.2.0
React version
18.3.1
Which browsers have you tested in?
Chrome, Edge
The text was updated successfully, but these errors were encountered: