feature request: add support for cross-tab sign in/out #1601
pimlie
started this conversation in
Ideas & Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Although its possible to implement this in user-land, i think it would be nice if this module would have built-in support to listen on storage events for
auth._token[strategy]
. Then when visitors have more than one tab open and they sign in/out on tab A, they will be automatically signed in/out on tab B, C etc too.The only (smallish) difficulty I have found with this is that you either have to store the user object in localStorage too or have to do an explicit fetchUserOnce in tab B. Currently I've opted for the 2nd approach, mostly because of privacy concerns as I prefer to not have user data lingering in localStorage (but maybe sessionStorage would be ok for sharing the user object though).
Here is an example of my current implementation:
Beta Was this translation helpful? Give feedback.
All reactions