react-google-login
react-google-login copied to clipboard
popup_closed_by_user
When I click the button it opens the Google popup window. The i am able to select my Google account and log in, BUT then the popup automatically closes and i am redirected back with this response:
{error: "popup_closed_by_user"}
Now i understand from the docs that it means The user closed the popup before finishing the sign in flow.
but it does not reflect the reality. After selecting my account it closed by itself and I have no idea how to get it to work.
I saw this other issue but even after enabling Google+ API i still get the error. https://github.com/anthonyjgrove/react-google-login/issues/132
Anybody has suggestions? Thanks
hi @stesvis , did you have any luck with that? I am experiencing the same issue and I have no idea what I am doing wrong
+1
+1
I got the same error without an explicit closing popup
Me too
For me it's back to normal. Maybe it's because I installed the lib
+1. Looking at the number of open issues is this library still actively maintained?
+1
Same here..... has anybody solved this?
@scottwilson312 I fixed it by adding scope key like below, but I agree there should be proper error msg if any props are mandatory.
<GoogleLogin clientId={process.env.REACT_APP_GOOGLE_CLIENT_ID} buttonText="Log in with Google" onSuccess={handleLoginResponse} onFailure={handleLoginResponse} cookiePolicy={'single_host_origin'} scope="profile" />
In case anyone is using Helmet, be sure to check your Cross-Origin-Opener-Policy as well. See my post here: https://github.com/anthonyjgrove/react-google-login/issues/132
+1
+1
+1
Are there any updates on this issue??
+1
+1
I've decided to drop this library and integrate using the old way https://developers.google.com/identity/gsi/web/reference/js-reference.
same error
same error
Hi, I had the same problem, I solved the problem using a helper library
import { gapi } from 'gapi-script';
useEffect(() => { function start() { gapi.client.init({ clientId : idCliente, scope : '' }) }; gapi.load('client:auth2',start); });
I hope it helped you
this is similar to this one, i think.
https://github.com/anthonyjgrove/react-google-login/issues/536#
Hi, I had the same problem, I solved the problem using a helper library
import { gapi } from 'gapi-script';
useEffect(() => { function start() { gapi.client.init({ clientId : idCliente, scope : '' }) }; gapi.load('client:auth2',start); });
I hope it helped you
This solved the problem for me.
For me it's back to normal. Maybe it's because I installed the lib
What lib?
I solve this problem with responseType="code"
property
<GoogleLogin
clientId={CLIENT_ID}
render={(renderProps) => (
<button onClick={renderProps.onClick} />
)}
onSuccess={handleSuccess}
onFailure={handleFailure}
responseType="code"
/>