@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.esm.js CHANGED
@@ -920,9 +920,14 @@ function AuthProvider({
920
920
  if (typeof window === 'undefined') return;
921
921
  const handleStorageChange = event => {
922
922
  if (event.key === 'auth:logout') {
923
- window.location.reload();
923
+ // Limpa o user do store - a aplicação redireciona automaticamente quando user é null
924
+ useAuthStore.setState({
925
+ user: null,
926
+ currentSession: null,
927
+ sessions: []
928
+ });
924
929
  }
925
- // Se o token mudou em outra aba, recarrega
930
+ // Se o token mudou em outra aba, verifica validade
926
931
  if (event.key === 'auth:token') {
927
932
  checkTokenValidity();
928
933
  }