react-google-login is not working on my incognito browser

Viewed 2310

I tried to add the login with google function on my project. My code is like followings:

<GoogleLogin
            clientId="my clientId"
            buttonText="Sign in with Google"
            onSuccess={handleSuccess}
            onFailure={handleFailure}
            cookiePolicy={'single_host_origin'}
            className="btn-google"
        />

It is working on general browsers, but not working on incognito browser. On incognito, I got the following error just after entering all credentials of my google account.

{error: "popup_closed_by_user"}
1 Answers

I am facing the same issue. As far as I know, this is because incognito window disable cookies. My production users are facing it in recent versions of Chrome browsers too, where the cookies are (for some reason) disabled. What I found on my research is to replace the authentication a server side authentication to solve the problem. However, I have not yet tried and this can be a huge impact in the whole authentication flow.

Related