<html>
<body>
<script src=”https://accounts.google.com/gsi/client” async defer></script>
<div id=”g_id_onload”
data-client_id=”THIS WAS MY CLIENT ID”
data-login_uri=”http://localhost:5500/callback.html”
data-auto_prompt=”false”>
</div>
<div class=”g_id_signin”
data-type=”standard”
data-size=”large”
data-theme=”outline”
data-text=”sign_in_with”
data-shape=”rectangular”
data-logo_alignment=”left”>
</div>
<script>
function handleCredentialResponse(response) {
console.log(“Encoded JWT ID token: ” + response.credential);
}
window.onload = function () {
google.accounts.id.initialize({
client_id: “THIS WAS MY CLIENT ID”,
callback: handleCredentialResponse
});
google.accounts.id.renderButton(
document.getElementsByClassName(“g_id_signin”)[0],
{ theme: “outline”, size: “large” } // customization attributes
);
google.accounts.id.prompt(); // also display the One Tap dialog
}
</script>
</body>
</html>
I can’t seem to get my google login/signup to work
john Asked question June 27, 2023