<script src="https://accounts.google.com/gsi/client"></script>
...
declare var google: any;
...
useEffect(() => {
const handleCredentialResponse = (response: any) => {
console.log(response);
};
const client_id = process.env.REACT_APP_GOOGLE_CLIENT_ID;
const callback = handleCredentialResponse;
const auto_select = true;
google.accounts.id.initialize({ client_id, callback, auto_select });
google.accounts.id.prompt((notification: any) => {
console.log(notification);
});
}, []);
Why does handleCredentialResponse
not get called at all? The user is prompted to log in, they hit continue and then the function never gets called! Grrr! Above taken from docs here and also here
The notification
logs out
nl {g: "display", h: true}
nl {g: "skipped", l: "issuing_failed"}