react-google-login icon indicating copy to clipboard operation
react-google-login copied to clipboard

Error "popup_closed_by_user"

Open dukeace2005 opened this issue 8 years ago • 60 comments

Getting 'popup closed by user' error after choosing Google account and clicking 'Allow' in popup screen. Here is my request: <GoogleLogin clientId='.....apps.googleusercontent.com' buttonText="Login" scope='https://www.googleapis.com/auth/drive.file' onSuccess={this.responseGoogle} onFailure={this.responseErrorGoogle}/>

dukeace2005 avatar Nov 30 '17 21:11 dukeace2005

+1 for this issue. Everything appears to work, but not getting anything in the response and seeing this error in the console.

Kinertia avatar Dec 06 '17 22:12 Kinertia

This is likely because your google + api is not enabled. Go to Library and search for plus api. There should be a result for google plus API, please enable it and try again.

mathurs avatar Dec 18 '17 10:12 mathurs

Any news on this?

alexghi avatar Feb 08 '18 15:02 alexghi

I was experiencing the same problem here. It was resolved when I re-created google credentials.

Go to https://console.developers.google.com/apis, and in the Google Plus API, access credentials, and create a new credential for "Oauth Client Id". In the "Application Type" select "Web Application". Be sure to put the full address of where the API is being called in the "Authorized redirect URIs". Finally, use the new "Client ID" that will be generated.

Despite this, the message displayed ("popup_closed_by_user") is not correct, so I believe the issue should be kept open.

dougneves avatar Feb 11 '18 02:02 dougneves

Also getting this error. And seems like it's random and based on loading status. Because sometimes when I wait enough, I'm not getting an error. What is more, after I added this button, sometimes I'm getting infinite loading after reload (and in this state, the button always returns popup closed by user)

tirli avatar Feb 19 '18 15:02 tirli

+1 this issue just started occurring for me...

glorp47 avatar Feb 19 '18 19:02 glorp47

Also happening to me

g33ktony avatar Mar 13 '18 17:03 g33ktony

Same for me

uplg avatar Mar 16 '18 17:03 uplg

Try clearing your browser cache

braco avatar Mar 20 '18 20:03 braco

Clearing cache can help for a while, though the main problem is that error description doesn't explain what happened. And it's what should be fixed.

tirli avatar Mar 20 '18 22:03 tirli

Having the same issue. It works normally in chrome, but getting { error: "popup_closed_by_user" } in firefox

dylankilkenny avatar May 09 '18 10:05 dylankilkenny

Clear browser cache and open new tab. It works for me.

xoapit avatar Jun 22 '18 04:06 xoapit

I have the same issue in chrome only. It works in Firefox and Safari

grugna avatar Aug 10 '18 16:08 grugna

its help me: https://github.com/anthonyjgrove/react-google-login/issues/132#issuecomment-364713349

prodislav avatar Sep 12 '18 10:09 prodislav

how about this issues ?

Drnutsu avatar Sep 17 '18 10:09 Drnutsu

Clear cache and refresh will work. It work for me.

khalidahmada avatar Oct 27 '18 09:10 khalidahmada

Got this error on local, fixed it by including port number in the 'Authorized JavaScript origins', which is http://localhost:8000 instead of http://localhost

Sunny-Lau avatar Jan 24 '19 03:01 Sunny-Lau

I fixed this issue by whitelisting

http://localhost

and adding cookiePolicy

<GoogleLogin clientId={WEB_CLIENT_ID} buttonText="Login with LF account" onSuccess={this.responseGoogle} onFailure={this.responseGoogle} cookiePolicy={'single_host_origin'} />

https://developers.google.com/identity/sign-in/web/reference#googleauththenoninit-onerror

subash-poudel avatar Jan 28 '19 07:01 subash-poudel

2019, the issue is still present. Hit me out of nowhere.

danmo avatar Feb 09 '19 16:02 danmo

Clearing the cache worked for me as well.

benjaminadk avatar Feb 26 '19 09:02 benjaminadk

for me, every time you have this error is because something is miss-configured, google or code.

thiagonache avatar Feb 28 '19 20:02 thiagonache

worked after clearing browser cache and cookies

vemarav avatar Mar 14 '19 10:03 vemarav

I have a website deployed that serves a number of domains. All my .com domains on this hosted site work fine but my .dev site simply will not work unless I use an incognito browser. I can even open a new computer and visit the site for the very first time and I get an error. (All browsers) Response from the iframe request : {"valid":false} Does anyone have any insight as to why?

retzion avatar Mar 28 '19 18:03 retzion

Response from the iframe request : {"valid":false} Does anyone have any insight as to why?

@retzion Configure your Authorized JS origin & redirect URI as mentioned in https://stackoverflow.com/a/53510968/8254487

junlee91 avatar Apr 20 '19 23:04 junlee91

Just cleared 1.3gb of cookies and cache but still no gain. Each time I try to sign up I get invalid client, right after setting http://localhost:3000 in google credentials

Curti-s avatar May 26 '19 08:05 Curti-s

Clearing the cache doesn't strike me as a good solution if you're trying to make sure your users aren't hit with this error.

This solution worked for me: https://github.com/anthonyjgrove/react-google-login/issues/132#issuecomment-458029717

narthur avatar Aug 27 '19 14:08 narthur

This is how I got it to work in Chrome, Go to Setting -> Advanced -> Clear browsing data -> Cached images and files -> Clear Data Also try this, going to site settings and make sure you allow 'Popups and redirects'

ahmedrafayat avatar Sep 27 '19 15:09 ahmedrafayat

09/2019 Still facing this issue, quite sad...

karel947 avatar Sep 29 '19 14:09 karel947

My colleagues on Mac and Windows face this problem as well. But on Mac more frequently

Edward101701 avatar Oct 16 '19 08:10 Edward101701

Check your browser plugins... Disable some which could potentially block trackers. In my case it was Privacy Badger

ap0ca avatar Nov 16 '19 22:11 ap0ca