nuxt-community / auth-module

Zero-boilerplate authentication support for Nuxt 2
https://auth.nuxtjs.org
MIT License
1.93k stars 924 forks source link

Sync $auth.user object between tabs #1723

Open trandaison opened 2 years ago

trandaison commented 2 years ago

Is your feature request related to a problem? Please describe.

Consider this case:

  1. Open the 1st tab, login to the account#1.
  2. Open the a new tab (account#1 is already logged in), do logout, then login with another account (account#2).
  3. Back to the first tab, navigate to any page by clicking nuxt-link (not refresh the whole app), the $auth.user object is still the data of account#1, but the tokens are now from account#2.

Describe the solution you'd like to see

Since the application from the first tab never refreshes, the user object is outdate. The user object from the first tab should be the data of account#2 too.

Describe alternatives you've considered

Additional context