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

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

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