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

popup_closed_by_user

Open stesvis opened this issue 3 years ago • 25 comments

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

stesvis avatar Jun 30 '21 20:06 stesvis

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

LucaConfa avatar Sep 02 '21 11:09 LucaConfa

+1

comur avatar Nov 12 '21 10:11 comur

+1

PiotrZak avatar Nov 17 '21 16:11 PiotrZak

I got the same error without an explicit closing popup

dmelechow avatar Nov 24 '21 23:11 dmelechow

Me too

LucasBarbosaSilva avatar Nov 27 '21 00:11 LucasBarbosaSilva

For me it's back to normal. Maybe it's because I installed the lib

LucasBarbosaSilva avatar Nov 30 '21 21:11 LucasBarbosaSilva

+1. Looking at the number of open issues is this library still actively maintained?

sabarishnarain avatar Dec 26 '21 03:12 sabarishnarain

+1

EvolverPawan avatar Jan 08 '22 05:01 EvolverPawan

Same here..... has anybody solved this?

scottwilson312 avatar Jan 12 '22 19:01 scottwilson312

@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" />

EvolverPawan avatar Jan 14 '22 21:01 EvolverPawan

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

henrymcl avatar Jan 19 '22 11:01 henrymcl

+1

MedinaGitHub avatar Apr 12 '22 15:04 MedinaGitHub

+1

yazharasu avatar Apr 21 '22 16:04 yazharasu

+1

nawedfarooque avatar May 23 '22 17:05 nawedfarooque

Are there any updates on this issue??

WagdySamih avatar May 29 '22 23:05 WagdySamih

+1

EliasAfara avatar Jun 05 '22 15:06 EliasAfara

+1

ReadyPlayerEmma avatar Jun 10 '22 21:06 ReadyPlayerEmma

I've decided to drop this library and integrate using the old way https://developers.google.com/identity/gsi/web/reference/js-reference.

sabarishnarain avatar Jun 12 '22 03:06 sabarishnarain

same error

Zaid1habib avatar Jun 14 '22 12:06 Zaid1habib

same error

MightyEagle96 avatar Jun 16 '22 09:06 MightyEagle96

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

joaoavila1987 avatar Jun 21 '22 15:06 joaoavila1987

this is similar to this one, i think.

https://github.com/anthonyjgrove/react-google-login/issues/536#

Jay-study-nildana avatar Sep 25 '22 12:09 Jay-study-nildana

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.

Kizito25 avatar Oct 21 '22 19:10 Kizito25

For me it's back to normal. Maybe it's because I installed the lib

What lib?

ojongfalon avatar Nov 02 '22 01:11 ojongfalon

I solve this problem with responseType="code" property

<GoogleLogin
  clientId={CLIENT_ID}
  render={(renderProps) => (
    <button onClick={renderProps.onClick} />
  )}
  onSuccess={handleSuccess}
  onFailure={handleFailure}
  responseType="code"
/>

joohaem avatar Jun 19 '23 10:06 joohaem