Skip to content

Instantly share code, notes, and snippets.

@carlosvini
Last active March 16, 2016 14:42
Show Gist options
  • Save carlosvini/36572ba03bc7f01e5b59 to your computer and use it in GitHub Desktop.
Save carlosvini/36572ba03bc7f01e5b59 to your computer and use it in GitHub Desktop.
Google Plus Callback
gapi.auth.signIn({
scope: 'email',
clientid: OATH2_CLIENT_ID,
callback: 'signinCallback',
cookiepolicy: 'single_host_origin',
approvalprompt: auto
});
function signinCallback(authResult){
if (authResult.status.method === 'AUTO') {
// when you click "Login" it calls this method
// before you confirm your e-mail
return;
}
if (authResult['access_token']) {
// success
} else if (authResult['error']) {
// error
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment