Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

305
Visualizações
How i can reset all the data when i signout() with firebase onr eact native?

I have a problem with my app, when I signout() and I want to create a new user, I still have some of the data of the previous user.

The app was coded by another developer (i have no contact with him) so I tried to find the problem.

there is also another problem with I logOut, I have this error

Uncaught Error in snapshot listener: [FirebaseError: Missing or insufficient permissions.]

my function logout :

// my button logout
const onLogout = () => {
    authManager.logout(currentUser);
    //dispatch(logout());
    props.navigation.navigate('LoadScreen', {
      appStyles: DynamicAppStyles,
      appConfig: DatingConfig,
    });
    setModalVisible(false);
  };
  const renderModalVisible = () => {
    setModalVisible(true);
  };


//then authmanager.logout()

const logout = (user) => {
  console.log('deco');
  const userData = {
    ...user,
    isOnline: false,
  };
  authAPI.updateUser(user.id || user.userID, userData);
  authAPI.logout();
};


//the authAPI.logout()
export const logout = () => {
  firebase.auth().signOut();

  RNFBAuth.auth().signOut();
};


it could also come from my persistent function but the process goes directly on the 'else'

const retrievePersistedAuthUser = () => {
  console.log('persiste');
  return new Promise((resolve) => {
    authAPI.retrievePersistedAuthUser().then((user) => {
      if (user) {
        handleSuccessfulLogin(user, false).then((res) => {
          // Persisted login successful, push token stored, login credential persisted, so we log the user in.
          resolve({
            user: res.user,
          });
        });
      } else {
        console.log('héééhoooooo');
        resolve(null);
      }
    });
  });
};
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda