As part of a university assignment, I’ve been attempting to integrate the One Tap Google Sign-In button into a website. Initially, the button was not functioning properly on a local server via Visual Studio Code. To troubleshoot, I deployed my project on GitHub Pages, which slightly improved the situation. However, a significant issue persists: on the first click, the account selection window appears, and after choosing an account, it only shows a loading screen without further progress. Subsequent attempts to click the button result in a loading screen without the account selection option, leading to no further action. Below, I will attach screenshots of my configuration in the Google Console and the relevant code snippets for further insight. I really need professional help. Thanks in advance for your answer.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="google-signin-client_id" content="my_id_here"/>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<title>Prihlásenie pomocou Google API</title>
</head>
<body>
<div id="content">
<p>Sign in:</p>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
</div>
<script>
function onSignIn(googleUser) {
let profile = googleUser.getBasicProfile();
console.log('Úplné meno: ' + profile.getName());
console.log('Meno: ' + profile.getGivenName());
console.log('Priezvisko: ' + profile.getFamilyName());
console.log("Obrázok profilu: " + profile.getImageUrl());
console.log("Email: " + profile.getEmail());
let id_token = googleUser.getAuthResponse().id_token;
console.log("ID Token: " + id_token);
document.querySelector("#content").innerHTML = "<p>Hello " + profile.getGivenName() + "! Click to <a href='#' onclick='signOut();'>sign out</a>.</p>";
}
function signOut() {
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function () {
alert("err");
location.reload();
});
}
</script>
</body>
</html
in google console to Ouath 2 all that i write
Authorized JavaScript origins – https://{here-nick-name}.github.io
Authorized redirect URIs – the sae link