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

336
Views
Google Sign-In button > How to logout user if he clicks on the google buttons

I'm new here I'm stuck on a functionality that I want to implement into my website : the Sign-In button using Google

For now, the following code add the Google Sign-In button and works fine :

    <meta name="google-signin-client_id" content="63XXXXXXX-hXXXXXXXXXXdj.apps.googleusercontent.com">
    <script src="https://accounts.google.com/gsi/client" async defer></script>

    <div id="g_id_onload"
      data-client_id="63XXXXXXX-hXXXXXXXXXXdj.apps.googleusercontent.com"
      data-login_uri="https://mywebsite.com"
      data-auto_prompt="false"
      data-auto_select="false"
      data-callback="handleCredentialResponse">
    </div>
    <div class="g_id_signin"
      data-type="standard"
      data-size="large"
      data-theme="outline"
      data-text="signin"
      data-shape="pill"
      data-logo_alignment="left"
      data-width=400>
    </div>

But according to the Google documentation, I need to use a "GoogleAuth.signOut()", and I don't know how to implement it in order to disconnect the actual user from my website and I found nothing on the web

Could someone help me in the implementation process of the logout action?

Thanks to everyone

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You should have the following code to run after your page is loaded

gapi.load('auth2', function() {
        gapi.auth2.init({'client_id':<client_id>});
      });

Then when user clicks on your logout button, it should trigger the following code (which is your GoogleAuth.signOut())

 gapi.auth2.getAuthInstance().signOut();
 
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!