Last active
June 16, 2022 08:04
-
-
Save Loupeznik/db15e3a2fccd9ee4f5d326aa62d790ff to your computer and use it in GitHub Desktop.
Google sign-in
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
<html> | |
<body> | |
<div> | |
<button onClick="ggl()">sign in with gugul</button> | |
</div> | |
<script> | |
function ggl() { | |
const redirectUri = 'http://localhost:3000/redir.html'; | |
const scope = 'openid%20profile%20email'; | |
const clientId = 'xxx.apps.googleusercontent.com'; | |
window.location.href = `https://accounts.google.com/o/oauth2/v2/auth?response_type=code&access_type=offline&scope=${scope}&redirect_uri=${redirectUri}&client_id=${clientId}&prompt=consent`; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment