How to logout from all tabs immediately? #1059
|
How to logout from all tabs immediately? |
Replies: 2 comments 1 reply
|
The current implementation doesn't have any auto logout. So if the user opens multiple tabs and presses logout in one tab, other tabs will stay logged in unless the user makes any API request or moves to another page (route). So the solution can be to check every sec if This feature, I'll consider. If I think, this feature has potential, I'll implement in the library itself But for now you have to implement by yourself. Thanks |
|
I think such behavior could be achieved by implementing WebSockets and publishing signout events. In that case, every other tab would know that signout just happened and could update accordingly. |
The current implementation doesn't have any auto logout. So if the user opens multiple tabs and presses logout in one tab, other tabs will stay logged in unless the user makes any API request or moves to another page (route).
So the solution can be to check every sec if
isAuthenticatedis returningtrueor not inside asetInterval. If it's not returning true, you can simply redirect the user to your desired page.This feature, I'll consider. If I think, this feature has potential, I'll implement in the library itself But for now you have to implement by yourself.
Thanks