user1934212 user1934212 - 17 days ago 7
Javascript Question

using google-sign.in in a webapp: sign out using Sign-In button

The following webpage explains an easy workflow to integrate google sign-in into a webapp:

https://developers.google.com/identity/sign-in/web/sign-in

After implementing the code, I am able to sign in using the "sign in" button, which shows "signed in" afterwards. How can I use this same button to sign out again? The linked tutorial only explains how to do that using a separate button.

Answer

I think you cannot use the same button for sign-out also. Instead you can add a sign-out button or link to your site and use the given signOut() function.