@riligar/auth-react 1.20.3 → 1.20.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -923,9 +923,14 @@ function AuthProvider({
923
923
  if (typeof window === 'undefined') return;
924
924
  const handleStorageChange = event => {
925
925
  if (event.key === 'auth:logout') {
926
- window.location.reload();
926
+ // Limpa o user do store - a aplicação redireciona automaticamente quando user é null
927
+ useAuthStore.setState({
928
+ user: null,
929
+ currentSession: null,
930
+ sessions: []
931
+ });
927
932
  }
928
- // Se o token mudou em outra aba, recarrega
933
+ // Se o token mudou em outra aba, verifica validade
929
934
  if (event.key === 'auth:token') {
930
935
  checkTokenValidity();
931
936
  }