Search code examples
javascriptfirebaseoauthfirebase-authentication

select_account prompt for Google Auth Provider in Firebase JS v9


In Firebase JavaScript v8, if you want to ask Google to show the account selection page every time you login, you can do:

var provider = new firebase.auth.GoogleAuthProvider();
provider.setCustomParameters({
  prompt: 'select_account'
});

But with the more modular design of v9, the above syntax is not possible. How do you achieve the same result (ie., ask Google Signin to show an account selection page every time the user logs in) in this newer version of Firebase?


Solution

  • So, after some time I stumbled onto the same documentation that I had read before. Not sure whether they've added it recently or if my eyes were malfunctioning before, what I wrote as "not possible" in the original question is actually possible. From the documentation:

    provider.setCustomParameters({
      'login_hint': '[email protected]'
    });