Multiple tabs trying to refresh token at once #217
Replies: 2 comments 1 reply
-
Hi, @tejaswini-developer! We looked into this a year or two ago, and we couldn't find any solution that didn't break other parts of the application, except one issue-mitigation: "Random stagger" (code in repo). Basically it should ensure that the token is refreshed at a random time for each of the tabs. Also, because So we do have some logic checking that two tabs shouldn't update at the same time, but it might be a bit inconsistent. Does this issue happen often for you, or just often enough that it stops the library from being useful? |
Beta Was this translation helpful? Give feedback.
-
Just to be sure. Which version of the library are used on the clients? 🙂 |
Beta Was this translation helpful? Give feedback.
-
When application is opened in multiple tabs and auth token is expired, all the tabs are trying to fetch new set of tokens using refresh token at once. And one of the tab is succeeding, to fetch new active auth token, which will invalidate previous refresh token and fetch new refresh token. Since the pervious refresh token is not valid any more, other tabs are failing to refresh tokens. With this issue, user have to refresh the sessions in middle of their work.
If there is way to pause other tabs refresh while one tab is refreshing that would be help to resolve the issue.
Would really appreciate if anyone suggest a way resolve this issue.
Beta Was this translation helpful? Give feedback.
All reactions