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

119
Visualizações
Firebase user signOut doesn't work in react native

I'm building an app and I'm handling the authentication with Firebase. The signIn create user functions work in the intended way, but for some reason, the signOut function doesn't work. When the button for the SignOut is clicked, the user should be signed out, but instead, he stays signed in

const signOutUser = () =>{
        console.log(authentication.currentUser.email)//before calling this is test@test.com
        signOut(authentication)
        .then((result) => {
            console.log(result)
        })
        .catch((error) => {
            console.log(error);
        })
        console.log("entered sign out functions")
        console.log(authentication.currentUser.email)//after above code runs this is till test@test.com
    }

Could somebody please advise what I'm doing wrong?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

const signOutUser = () => {
    console.log(authentication.currentUser.email);
    signOut(authentication).then((result) => {
        console.log(result);
        console.log("entered sign out functions");
        console.log(authentication.currentUser.email);
    }).catch((e) => { console.log(e) })
}

or

const signOutUser = async() => {
    // add try catch if you want
    console.log(authentication.currentUser.email);
    const result = await signOut(authentication);
    console.log("entered sign out functions");
    console.log(authentication.currentUser.email);
}

You should await the signOut or write your code in then(). If this is still not working, you probably made a mistake with your signOut(authentication) function.

about 4 years ago · Juan Pablo Isaza Relatório
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