Skip to content

GoogleAuth.signOut() does not sign out from Google #419

@SGYUM

Description

@SGYUM

I am able to use "Login with Google" successfully and now trying to implement Logout from Google using below standard Google javascript SDK for logout. It executes without any error and displays "User signed out" but does not logout user from gmail (or any google signed in in another tab ). How to logout a user from Google itself?

<script src="https://apis.google.com/js/platform.js?onload=init" async defer></script>
<script> function init() {
gapi.load('auth2', function() {
// Ready.
gapi.auth2.init(
{
client_id: 'deleted'
});
});
}
function googleLogout() {
    alert("googleLogout start");
    //gapi.auth2.getAuthInstance().signOut();
    //OR (both are same)
    var auth2 = gapi.auth2.getAuthInstance();
	    auth2.signOut().then(function () {
       	console.log('User signed out.');
	   });   
    alert("googleLogout done."); 
}      
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions