-
-
Save danieldroit/abaeb5b5ae4019f1d70f6813eb983616 to your computer and use it in GitHub Desktop.
Google one tap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<div id="g_id_onload" | |
data-client_id="390285071447-nulpiuehvrjqg91cnah18sj52mlt9c2b.apps.googleusercontent.com" | |
data-callback="handleCredentialResponse"> | |
</div> | |
<script src="https://accounts.google.com/gsi/client" async defer></script> | |
<script src="https://cdn.jsdelivr.net/npm/jwt-decode@2.2.0/build/jwt-decode.min.js"></script> | |
<script> | |
function handleCredentialResponse(response) { | |
var decodedToken = jwt_decode(response.credential); | |
console.log(decodedToken.name); | |
console.log(decodedToken.email); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment