I have a Google Sign In Button in my App. And it works fine. But if user is not authorized (default state), I have an error message in console.
My app doesn't use any play.google.com services. Why it's trying to connect to it? And how to disable this?
Code, that render button:
React.useEffect(() => {
const script = document.createElement("script");
script.src = "https://accounts.google.com/gsi/client";
script.id = "google-client-script";
const buttonRef = googleButtonRef.current!;
script.onload = () => {
if (
window !== undefined &&
window.google !== undefined &&
buttonRef !== null
) {
window.google.accounts.id.initialize({
client_id: clientId,
callback: handleCredentialResponse, // get auth response
});
window.google.accounts.id.renderButton(
buttonRef,
{ type: "icon", shape: "circle" } // customization attributes
);
}
};
script.async = true;
document.body.appendChild(script);},
[]);
