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

382
Visualizações
Problem doing SignOut in firebase (email method) (react / firebase)

I am having the following problem that I am noticing at this stage of my application, when I signOut with one account, and then I decide to log in with another when executing actions, it keeps bringing the credentials of the first one. But if I signOut again and log in again with this last account, it already brings me the correct credentials. What is happening here? I do not understand and take me with a mode of clearPersistance, but I understood that it has no use for what I need.

    useEffect(() => {
    onAuthStateChanged(auth, async(logFirebase) => {
      if (logFirebase) { 
        sendEmailVerification(logFirebase)   
        setUsuarioGlobal(logFirebase);
        setUserMail(logFirebase.email);
        if (!logFirebase.emailVerified) {
          let intervalVerified = setInterval(() =>{
            setEmailVerificated(logFirebase.emailVerified)
            logFirebase.reload().then(ok =>{
              if(logFirebase.emailVerified === true){
                setEmailVerificated(logFirebase.emailVerified)
                clearInterval(intervalVerified)
              }
            })
          }, 5000)
        }
      } else {
        setUsuarioGlobal(null);
      }
    });
  }, []);


 const handleSignOut = () => {
    signOut(auth);
  };

signInWithEmailAndPassword(auth, email, password)
        .catch((error) => {
          if (error.code === "auth/user-not-found") {
            setErrorMsg("Email no encontrado, registrate!");
          }
          if (error.code === "auth/wrong-password") {
            setErrorMsg("Contraseña incorrecta!");
          }
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