Skip to content

Instantly share code, notes, and snippets.

@msaxena25
Created June 12, 2018 09:08
Show Gist options
  • Save msaxena25/e19988d400df002445a0760846fd056b to your computer and use it in GitHub Desktop.
Save msaxena25/e19988d400df002445a0760846fd056b to your computer and use it in GitHub Desktop.
Angular 5 - Gmail Logout
(<any>window).gapi.load('auth2', () => {
(<any>window).gapi.auth2.init().then(() => {
var auth2 = (<any>window).gapi.auth2.getAuthInstance();
auth2.signOut().then((res) => {
if (response.responseCode == 'S0001') {
window.location.href = '/login';
}
})
.catch((err) => { console.log('error is ', err) });
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment