anthonyjgrove / react-google-login

A React Google Login Component
https://anthonyjgrove.github.io/react-google-login
MIT License
1.85k stars 425 forks source link

Error "popup_closed_by_user" #549

Closed athira1693 closed 1 year ago

athira1693 commented 1 year ago

I'm trying to login by proving username and password, but end up getting the error "popup_closed_by_user" as response. I'm using react 18.2.

andyzeli commented 1 year ago

its because google is deprecating the js platform this library uses, so its rejecting your client id

athira1693 commented 1 year ago

Ok. Only way I found to solve it was using gapi-script and it works now.

bibhuti9 commented 1 year ago

use this code, import { gapi } from 'gapi-script';

useEffect(() => { function start() { gapi.client.init({ clientId: '1041045167972-lb4921n8pk2g1n5500318pdb5jhdsk3i.apps.googleusercontent.com', scope: 'email', }); }

    gapi.load('client:auth2', start);
}, []);