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

238
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 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