question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there anyway to force an account selection screen on login?

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

39reactions
Anivialcommented, Jan 20, 2021

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"
/>
2reactions
dvnecroillusioncommented, Jan 27, 2021

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Hide or Show User Accounts from Login Screen on ...
You can hide specific users from the list on the welcome screen through the registry. To do this, you need to use the...
Read more >
User Select on Windows Startup - Microsoft Community
I would like this option to show up on my startup screen instead of it forcing me to choose the last used user....
Read more >
Force Google Account Selection on every login - FusionAuth
FusionAuth automatically creates the account, but user doesn't get registered ... ... by-passing the Google account selection screen.
Read more >
Windows 10 Pro. Force the Login Screen to appear on every ...
The 'fix' for this (once it happens) is to Right click START, Choose "Sign out, which takes her to the normal Sign In...
Read more >
Force Windows 8 to show all user accounts on the Sign on ...
Next, you'll need to configure a Trigger. To do so, select the Triggers tab and then click the New button. When you see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found