Closed rhuber-rbi closed 1 year ago
remove access_type
prop
I have already tested but the popup to login doesn't appear consistently, today in the morning I had the problem several times when I clicked on login and any popup appeared also any error on the console or network tab, if you click 3 or 4 times you will not get the google popup anymore
also when I make click It fires a request to https://accounts.google.com/gsi/log?client_id.... and the response for that is 200
try the code below:
<LoginSocialGoogle
client_id={
""
}
onLoginStart={onLoginStart}
redirect_uri={REDIRECT_URI}
typeResponse="idToken"
scope="openid profile email"
ux_mode="popup"
onResolve={({ provider, data }) => {
}}
onReject={(err) => {
console.log(err);
}}
>
....
</LoginSocialGoogle>
nope, same behavior, it works fine 2 or 3 times then it doesn't appears anymore, but the issue is just when we asking for idToken, with accessToken works fine every time
When It starts failign I see this message on chrome console issues tab
have you tried my demo on site? Does it work?
Yes I did it, and for example, if you click on Google login and close the popup and click again the popup doesn't show(applies the same if you make the login 3 or 4 times), I did some more research and I found that this cookie "g_state" is causing that issue if you set this and force a re-render it starts working again
g_state=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT
you need to call logout function before click to login button again.
After the login success, the logout works fine, but the logout doesn't work if I didn't make a login as I'm closing the popup before making the login, I have solved by adding this to the onLoginStart
window.google.accounts.id.prompt(notification => {
if (notification.isNotDisplayed() || notification.isSkippedMoment()) {
// clear g_state cookie if the pop-up has already been closed
document.cookie = `g_state=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT`;
}
});
I'm not able to create a branch on your repo, if you want the fix this is the patch, you can test it if you want fix-g_state_google.patch
if you want to make any changes, please fork this project and make a Pull Request to i can review it. Thank you.
Describe the bug Hi guys I'm getting this error when I use idToken the popup to select the account doesn't appears
<LoginSocialGoogle client_id={googleServiceWebClientIds} fetch_basic_profile={true} ux_mode={'popup'} typeResponse="idToken" access_type={'offline'} discoveryDocs={'claims_supported'} onResolve={({ data }: IResolveParams) => {