Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

isAuthenticated flag is false after refresh #5

Open
wityan opened this issue Nov 18, 2019 · 5 comments
Open

isAuthenticated flag is false after refresh #5

wityan opened this issue Nov 18, 2019 · 5 comments

Comments

@wityan
Copy link

wityan commented Nov 18, 2019

After refreshing the Page the isAuthenticated flag is false but in the cookie its set to true

@sandrinodimattia
Copy link
Owner

When you refresh the page your browser will execute a "silent authentication request" and receive a new id_token and access_token from Auth0. During that step, you'll have a second that isAuthenticated is false.

However, as soon as the new tokens are received (if the user still has a valid session with Auth0), you'll see that the flag updates to true.

Let me know if this helps.

@sourceful-sharon
Copy link

Hi -

It's not updating to true for me.
False -> Login -> True.
Refresh -> False again even though cookie is set.

I can see the call goes out to auth0 which returns 200 but I'm not able to capture that in the update when getting const { isAuthenticated, isLoading, login, logout } = useAuth();

@sourceful-sharon
Copy link

This seems broken on the actual example site too. Login to profile, refresh and you are logged out and need to log back in.

@esteban89
Copy link

Any way to fix this? I'm running into this error

@sandrinodimattia
Copy link
Owner

All of the concepts of this library have been moved to the official Auth0 SDK for React (https://github.com/auth0/auth0-react), so I'll be archiving this repository shortly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants