Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!