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
constauthOptions={// keepSessionAlive: true // Uncomment this in order to maintain the session alive};
I understood that this should maintain the authenticated session across refreshes and browser restarts.
However, this doesn't seem to work. The app always restarts with no data in the auth store.
Thanks for the info!
After browser restart, in the empyt state, are you redirecting to the login dialog and redirected immediately back OR does the user has to actually login?
Yah I see what you mean. It indeed keeps the session when I call useLoginWithRedirect the 2nd time, and automatically logs in and redirects me back. I have two problems here:
If I want to provide some views to an unauthenticated user, then I don't have a clean way to determine whether this session has signed in already or not. I can't just login with redirect everyone, because some of my views should be visible for unauthenticated users. Yet I still want to maintain the login info to provide things such as user avatar at the corner, and navigation options according to permissions.
Even if I separate authenticated views and unauthenticated views, and redirect only on the former. The screen redirection every refresh looks bad, and takes quite a bit of time.
I'm completely fine with storing these short term JWTs in my local storage to avoid these redirections and slowness.
We are now introducing a silent refresh mode for our hosted login mode. This will keep the isAuthenticated mode enabled when the cookie is available for a refresh on the client side.
Overall we are against storing JWT on local storage due to XSS attack vectors. This is why we are not doing it on our end.
I will update this ticket once this is pushed
Describe the bug
From the documentation:
I understood that this should maintain the authenticated session across refreshes and browser restarts.
However, this doesn't seem to work. The app always restarts with no data in the auth store.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
After refresh you still see the "logged in as" view.
Additional context
At the moment I implemented a workaround which manually stores the user object in storage at point of login:
And uses it when available in construction of the provider:
I also invalidated the storage when logging out:
but since I don't have a hook on 401s from the session endpoint, I cannot invalidate it when it expires or is malformed.
The text was updated successfully, but these errors were encountered: