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

237
Visualizações
New Google Sign In library prompt at every page reload

In my project, I use regular popup client-sided JS authentication (platform client)

I migrated from old Google Sign in to new Google Identity Platform (gsi client)

I used the simple exemple code

window.onload = function () {
  google.accounts.id.initialize({
    client_id: 'YOUR_GOOGLE_CLIENT_ID',
    callback: handleCredentialResponse,
    auto_select: true
  });
  google.accounts.id.prompt();
}

My problem is, each time a user reload the page, he gets the One Tap UX prompt which take tremendous time

A second problem to that is if a user have 2 Google account connected to his browser, the prompt ask him to choose the account everytime he reloads (like it's not saved)

How can I achieve the behavior I had with the last library which is too simply have nothing changed at page reload but only when connecting the first time ?

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

0

I think Automatic sign-in is what you need.

Google One Tap supports automatic sign-in, which provides a frictionless user experience (UX) by removing the manual steps visitors must take when returning to your site. Users don't need to remember which Google Account they selected during their last visit, decreasing the chances of unnecessary duplicate accounts being created on your platform.

Automatic sign-in is intended to complement our Sign In With Google button and One Tap dialogs. It is designed to be used across your entire site, with manual sign-up or switching accounts occurring only after the user has first signed-out of your site.

To enable automatic sign-in, add data-auto_select="true" to your HTML code, as shown in the following snippet:

<div id="g_id_onload"
     data-client_id="YOUR_GOOGLE_CLIENT_ID"
     data-auto_select="true"
     data-login_uri="https://your.domain/your_login_endpoint">
</div>

Refer: https://developers.google.com/identity/gsi/web/guides/automatic-sign-in-sign-out#sign-in-users-automatically

about 4 years ago · Juan Pablo Isaza Relatório

0

After some research it was determined that this issue might be caused by callback function that handles an ID token. I would like to add that your Singing method is correct and other users also do it this way as seen here. I think you should take a look at the Authenticate with a backend server guide to know how to handle these tokens, .

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