[Auth] Allow user select GitHub account on login#3801
Conversation
huchenlei
left a comment
There was a problem hiding this comment.
Did you verify this does allow multiple github account to be selectable?
Based on my previous chat with LLM, it seems like github provider does not need special configuration.
Let me check the Firebase documentation and the current implementation to answer your question.
Looking at the code, I can see that the Google provider is set up with a custom parameter to prompt account selection:
const googleProvider = new GoogleAuthProvider()
googleProvider.setCustomParameters({
prompt: 'select_account'
})For GitHub authentication, the select_account parameter is not applicable. This is because GitHub's OAuth implementation works differently from Google's. GitHub's authentication flow already handles account selection differently:
- If you're not logged into GitHub, it will show the login page
- If you're logged into GitHub, it will directly use that account
- If you want to use a different GitHub account, you need to log out of GitHub first
So there's no need (and no way) to set a select_account parameter for the GitHub provider. The current implementation is correct as is:
const githubProvider = new GithubAuthProvider()This is the standard way to implement GitHub authentication with Firebase, and it follows GitHub's OAuth best practices.

Continuation of #3777. Allow using multiple GitHub accounts per client.
OAuth parameters: https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml
┆Issue is synchronized with this Notion page by Unito