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

416
Vistas
GoogleSignIn Authentication in React Native

I'm confused related to the GoogleSignIn Logout first I've managed to SignIn my google account, the problem is when I logout my google account, and SignIn again the previous account that you login before it didn't ask the password like the image below when I click one of user account it will go to my home screen directly instead asking password for that google account since I've already logout the account in my app.

enter image description here

This is my logout function I tried the code below it works in some other way but my concern is since I've already logout the account it should not directly go to homepage when SignIn again ask password to the user or remove user when logout? What is the best way should I do, do I correcly implement it?

   const [user, setUser] = useState(null);
   logout: async () => {
      try {
        await GoogleSignin.revokeAccess();
        await GoogleSignin.signOut();
        setUser({ user: null });
        await auth().signOut();
        
      } catch (e) {
        console.log(e);
      }
    },

GoogleSign function

  return (
    <AuthContext.Provider
      value={{
        user,
        setUser,
        googleLogin: async () => {
          try {
            // Get the users ID token
            const Token  = await GoogleSignin.signIn();
            const {idToken} =  Token;
            
            // Create a Google credential with the token
            const googleCredential = auth.GoogleAuthProvider.credential(idToken);
        
          
            // Sign-in the user with the credential
            await auth().signInWithCredential(googleCredential)            
            .catch(error => {
                console.log('Something went wrong with sign up: ', error);
            });
          } catch(error) {
            console.log({error});
          }
        },
      }}>
      {children}
    </AuthContext.Provider>
  );
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Short Answer: Your code is completely fine!

Long Answer: This is completely normal behaviour and is intended to be. If you want to Sign Out completely you would have to go into the settings of the corresponding google account and sign out from that device. (Manage Google Account => Security => My Devices => Logout)

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