Really enjoying the library so far! I am following this medium tutorial (Link) that really doesn't deviate much from the basic configuration of setting up a login and logout button
<GoogleLogin
clientId={clientId}
buttonText="Login"
onSuccess={onSuccess}
onFailure={onFailure}
cookiePolicy={'single_host_origin'}
style={{ marginTop: '100px' }}
isSignedIn={true}
/>
<GoogleLogout
clientId={clientId}
buttonText="Logout"
onLogoutSuccess={onSuccess}
/>
I can successfully login and logout however after the first login/logout I am no longer prompted to re-enter my password /email
and I it just automatically signs into the account I previously logged in as.
I am on version "react-google-login": "^5.2.2",
and the codebase in the tutorial is using "react-google-login": "^5.1.20".
I tested in all relevant browsers and the same thing is occuring;
in the deployed example of the tutorial Link even when I login for the first time and logout each subsequent login prompts me to choose which account I want (the behavior I desire) I can see the popup for sign in for the tutorial is pointed at the URL
https://accounts.google.com/_o/oauth2/auth/oauthchooseaccount_?redirect_uri = .....
Whereas using my version of this library will point to the URL
https://accounts.google.com/o/oauth2/auth?redirect_uri= ....
Is there anyway to get the account selection URL back, maybe as a prop?
Hello! I have the same problem here. I need to force the account selection because I use google login to authenticate users trough their company gmail and users can't select the correct email if they are already logged in with some other google account on their browser.
Thanks!
Hello @ethanny2 @dvnecroillusion ! I found a way to force it, juste add prompt="select_account" in the props of the GoogleLogin component, just like this:
```
className="google_sign_in"
buttonText="Sign in with Google"
onSuccess={this.onLoginSuccess}
onFailure={this.onLoginFailure}
cookiePolicy="single_host_origin"
prompt="select_account"
/>
````
Hello @ethanny2 @dvnecroillusion ! I found a way to force it, juste add
prompt="select_account"in the props of the GoogleLogin component, just like this:<GoogleLogin clientId={CLIENT_ID} className="google_sign_in" buttonText="Sign in with Google" onSuccess={this.onLoginSuccess} onFailure={this.onLoginFailure} cookiePolicy="single_host_origin" prompt="select_account" />
It works, thanks a lot!
Yes I think I missed that prop from the documentation; thanks for the help!
Most helpful comment
Hello @ethanny2 @dvnecroillusion ! I found a way to force it, juste add
prompt="select_account"in the props of the GoogleLogin component, just like this:```
clientId={CLIENT_ID}
className="google_sign_in"
buttonText="Sign in with Google"
onSuccess={this.onLoginSuccess}
onFailure={this.onLoginFailure}
cookiePolicy="single_host_origin"
prompt="select_account"
/>
````