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
is there a way to exclude displayName on GoogleSignIn

I don't want to retrieve the user name or profile photo that the user has on their Google Account.

export async function signUpGoogle() {
try {
    const result = await Google.logInAsync({
        androidClientId: GOOGLE_ANDROID_CLIENT_ID,
        iosClientId: GOOGLE_IOS_CLIENT_ID,
        scopes: ["email"],
    });

    //console.log(result);

    if (result.type === "success") {
        const credential = GoogleAuthProvider.credential(result.idToken);

        signInWithCredential(auth, credential).catch((error) => {
            console.log(error);
        });
    } else {
        console.log("cancelled");
    }
} catch (e) {
    return { error: true };
}}

The code I use for GoogleSignIn is above.

versions:

"expo": "~44.0.0",
"expo-google-app-auth": "~8.3.0",
"firebase": "^9.1.3",
"@react-native-firebase/auth": "^12.9.3",
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

This should help

    const { user } = await auth.signInWithCredential(credential);
    const user = {
      photoURL: user.photoURL,
      displayName: user.displayName ?? 'User',
      uid: user.uid,
      email: user.email,
    };
about 4 years ago · Juan Pablo Isaza Relatório

0

When you sign in with Google, the result that you get contains all that information, the UID, the display name, the profile picture URL. There is no way to exclude those fields. If you don't want to use them, then simply ignore them.

However, if don't want to get user details, then you should consider implementing Firebase Anonymous Authentication. In this way, you'll only have a UID, that can be only used to differentiate users. That's it.

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