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

200
Visualizações
Google One tap identify a returning user and get id and email

I am implementing Google One tap and I am not understanding how to get the id of a user who has already authorize my application refresh or close the windows and reopen it again. My console is empty, but I can see that Google authentifies him. Here is my Google One tap code :

window.onload = function () {
    google.accounts.id.initialize({
        client_id: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com',
        auto_select: true,
        callback: data => handleCredentialResponse(data),
        state_cookie_domain: 'https://www.healxxxxxxxx.cm',
    });
    google.accounts.id.prompt((notification) => {
        if (notification.isNotDisplayed() || notification.isSkippedMoment()) {
            // try next provider if OneTap is not displayed or skipped
            
        }
    });
}
function handleCredentialResponse(response) {
    //console.log(response)
    user = parseJwt(response.credential);
    console.log("ID: " + user.sub);
    console.log('Full Name: ' + user.name);
    console.log("Email: " + user.email);
    console.log(JSON.stringify(parseJwt(response.credential)));
}

The code is supposed to ask authentication onload of the page. As soon as the user authorizes the app to get informations, I can see them via the function handleCredentialResponse. But when reloading the page and authorization already given, how I get the data of the user ?

If I se session, closing the browser will throw all informations. If I use cookies, I will be unable to use it on another browser. So how to read the data of the connected user who has already authorize my app ?

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