Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

383
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda