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

335
Visualizações
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 Respostas
Responde à pergunta

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