I am using Google Auth OAuth 2.0 One Tap Sign and Sveltekit, and I got some really weird behavior, I followed this doc https://developers.google.com/identity/gsi/web/guides/overview with javascript
onMount(async () => {
const handleCredentialResponse = async (response) => {
console.log('Encoded JWT ID token: ' + response.credential);
};
google.accounts.id.initialize({
client_id: clientId,
callback: handleCredentialResponse,
});
google.accounts.id.renderButton(
document.getElementById('buttonDiv'),
{ theme: 'outline', size: 'large' } // customization attributes
);
google.accounts.id.prompt();
});
Sometimes it works everything goes well,
Sometimes I got
- Uncaught (in promise) ReferenceError: google is not defined And some mobile / mobile browsers I get
- [GSI_LOGGER]: The given origin is not allowed for the given client ID. but works on laptop
Hope someone can understand and help.
Do we have any way to check logs for investigation?
Comments
Post a Comment