title: Prevent google from automatically triggering data-onsuccess="onSignIn"
body: <p>I did google connect to let users login using their google account.</p>
  
  <p>What i did was, to create a button</p>
  
  <pre><code>&lt;div class="g-signin2 social_signin" data-onsuccess="onSignIn"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Then created onSignIn()</p>
  
  <pre><code>&lt;script&gt;
    function onSignIn(googleUser) {
      // Useful data for your client-side scripts:
      var profile = googleUser.getBasicProfile();
      console.log("ID: " + profile.getId()); // Don't send this directly to your server!
      console.log("Name: " + profile.getName());
      console.log("Image URL: " + profile.getImageUrl());
      console.log("Email: " + profile.getEmail());
  
      // The ID token you need to pass to your backend:
      var id_token = googleUser.getAuthResponse().id_token;
      console.log("ID Token: " + id_token);
    };
  &lt;/script&gt;
  </code></pre>
  
  <p>Then send that token to PHP server for validation and fetching data. That works fine.</p>
  
  <p>But my problem is that, when a user is logged out from my website, google automatically triggers 'onSignIn' without clicking on the button i created. So when user is logged out, user automatically get logged in again.</p>
  
  <p>Can you help me here to prevent this automatic login? Or can i de-authorize the user? </p>