Open MrUsefull opened 3 years ago
I am also having this same issue. The request is being sent without interaction.
I'm facing the same issue
yes I was facing this same issue.
use prop autoLoad={false}
this will solve the issue
The demo repo shows the issue with autoload set to false: https://github.com/MrUsefull/react-google-login-auto-demo/blob/master/src/App.js
any update on this?
i also face this issue
<GoogleLogin
className="btn btn-dark-outline btn-lg"
render={(renderProps) => (
<CButton
block
color="dark"
variant="outline"
size="lg"
onClick={renderProps.onClick}
>
<img
className="mr-3"
width="18"
src={googleIcon}
alt="icon"
/>
Sign up with Google
</CButton>
)}
clientId={
process.env.REACT_APP_GOOGLE_CLIENT_ID
}
onSuccess={handleGoogleSignUp}
onFailure={handleGoogleSignUp}
cookiePolicy={"single_host_origin"}
autoLoad={false}
isSignedIn={false}
/>
any update on this? project seems inactive.
on page load, the onSuccess callback will be triggered automatically, even if I set autoLoad = {false}
Looks like the lack of error handling creates this issue. same here.
In my case the error was
{error: 'idpiframe_initialization_failed', details: 'Cookies are not enabled in current environment.'}
So basically the button checks the config and throws an error immediately after rendering
Is there any workaround for this issue? autoload
prop doesn't work.
Is there any similar lib like this? Critical bug that we can't release with.
Same here : onAutoLoadFinished is called with 'true' even if autoLoad is set to false.
when run it on http, I got the issue. after run it on https there was no auto calling issue.
If your browser is blocking third-party cookies, then Google with throw an error as soon as the button renders. The workaround would be to store whether the the button has been clicked, and then display the error only after the button has been clicked. Note the error thrown post-click is often different from the error thrown pre-click.
Any update on this? The prop autoload doesn't work.
I faced to same issue. i resolved it just using
onAutoLoadFinished={true}
it may help.
This is also not working and it is rendering automatically. Can someone please have a look at this ?
autoLoad property isn't working for me too. any workarounds?
I've created a demo app here demonstrating the behavior.
Here are request logs for the demo app above after running npm start with no user interaction: