Skip to content

Instantly share code, notes, and snippets.

@nolvuscodes
Created April 4, 2020 05:15
Show Gist options
  • Save nolvuscodes/e28731f18335cbae9bac764da1e34d99 to your computer and use it in GitHub Desktop.
Save nolvuscodes/e28731f18335cbae9bac764da1e34d99 to your computer and use it in GitHub Desktop.
<html>
<head>
<meta name="google-signin-client_id" content="188042955796-9aeupnhgu1j5p46unsjs3cln8aqt3f79.apps.googleusercontent.com">
</head>
<body>
<div id="my-signin2"></div>
<script>
function onSuccess(googleUser) {
console.log('Logged in as: ' + googleUser.getBasicProfile().getName());
}
function onFailure(error) {
console.log(error);
}
function renderButton() {
gapi.signin2.render('my-signin2', {
'scope': 'profile email',
'width': 240,
'height': 50,
'longtitle': true,
'theme': 'dark',
'onsuccess': onSuccess,
'onfailure': onFailure
});
}
</script>
<script src="https://apis.google.com/js/platform.js?onload=renderButton" async defer></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment