Skip to content

Instantly share code, notes, and snippets.

@iskenxan
Created March 25, 2019 03:31
Show Gist options
  • Save iskenxan/cd169ae6776539bc6873ebe05d03b88f to your computer and use it in GitHub Desktop.
Save iskenxan/cd169ae6776539bc6873ebe05d03b88f to your computer and use it in GitHub Desktop.
Gmail addon login page
<!DOCTYPE html>
<head>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="<%= clientId %>">
</head>
<body>
<div>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
</div>
<script>
function onSignIn(googleUser) {
var idToken = googleUser.getAuthResponse().id_token;
window.location.replace('<%= redirectUri %>?success=1&response_type=<% responseType %>&state=<%= state %>&code=' + idToken);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment