use-auth0-hooks icon indicating copy to clipboard operation
use-auth0-hooks copied to clipboard

isAuthenticated flag is false after refresh

Open wityan opened this issue 5 years ago • 5 comments

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

wityan avatar Nov 18 '19 12:11 wityan

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.

sandrinodimattia avatar Dec 05 '19 13:12 sandrinodimattia

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 avatar Apr 25 '20 21:04 sourceful-sharon

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

sourceful-sharon avatar Apr 25 '20 21:04 sourceful-sharon

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

esteban89 avatar Jun 20 '20 01:06 esteban89

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.

sandrinodimattia avatar Jun 23 '20 12:06 sandrinodimattia