-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Silent refresh fails using localStorage when multiple tabs trying to refresh at the same time #1662
Comments
@medeirosrich I tried to reproduce the issue, but from my side, everything works well. Can you please prove the AuthModule configuration? |
|
@medeirosrich I have the same configuration and everything works well with multiple tabs. |
@medeirosrich your AuthConfigModule was added to the imports of the main AppModule? and can you please show the code of your LocalStorageManagerService? because localstorage by default shared all data between all tabs and windows from the same origin. |
@TarasKovalenko Yes
And the LocalStorageManagerService
|
Hi @TarasKovalenko, is local storage with multiple browser tabs/windows supported? |
Hi @VaclavChalupa , is local storage with multiple browser tabs/windows supported - about tabs for sure, but about windows it's hard to say. data will be saved even if you close and open the browser again. so I guess the answer is yes (but not related to the incognito window) |
Hello, We’re facing the same issue… We try so many things to solve it, but we’re stuck. Versions : Contexte :
We’re using localStorage with a custom class the same as the documentation, but with providedIn ‘root’ in order to use the same instance in other places inside our app. We’re using silentRenew (without Iframe). When we’re using the application in a single tab, no problem : silent renew works perfectly. Has-new is an HTTP polling request. Left screen is a tab, the right another.
Error always appeared after the « keys » http call. The call response is always return from disk cache (I don’t know if its a problem as it works in single tab with this behavior). @medeirosrich Did you find a solution ? Thanks in advance |
@Adrii77 We did not. We switched to using sessionStorage for now. |
@damienbod I see you closed this bug, does that mean the concurrency issue when using localStorage is fixed? |
@medeirosrich I guess not. Damien answered on this topic : #1716 (comment) My client often need to open my app into another tab. If I use sessionStorage, he'll need to sign in on each tab... that's not a great UX. |
I am also facing similar issues. Session storage is not ideal as we want the authentication state to be preserved when the user opens the app in a new tab. Any joy? |
We found a temporary solution with localStorage, which we're still experimenting right now : We set the
|
Hello, I have the same problem when I use localStorage. A temporary solution does not suit me well, because my token functions for 300 seconds. Do you have any advice or solutions for me? Version: 16.0.0 |
@joewIST I didn't see that error. We use localStorage, and when we use multi tabs, we get this error. |
This is still an issue for us, has anyone been able to find a workaround for using localStorage + silentRenew? It definitely seems to be linked to multiple tabs refreshing at the same time... I'm not sure it should be closed. |
We are running in to exactly the same problem using localStorage + silentRenew and multiple open tabs. |
Version
5.0.3
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Steps to reproduce the behavior
A clear and concise description of what you expected to happen.
Additional context
It seems that multiple tabs simultaneously attempting to refresh the token using a shared localStorage is causing a race condition, resulting in validation failure.
The text was updated successfully, but these errors were encountered: