If a user clicks "Sign in with Email" and types in an email address that is associated with a Google account, they are prompted to sign in with Google.
But then the user is asked again to select which Google account to use, instead of automatically using the account associated with the email address which triggered the flow, which they had typed in manually. Users therefore have complaints, as this is confusing.
Is there a way to get around this? (eg. via the 'login_hint' custom parameter?)
*I am not using AccountChooser, because of https://github.com/firebase/firebaseui-web/issues/85#issuecomment-287573540, but I have double-checked with the example site (https://fir-ui-demo-84a6c.firebaseapp.com), and there is the same problem. A user is forced to select their account twice, once in AccountChooser and then again the Google flow.
We can pass the login_hint here. However, keep in mind, only Google supports this. This will only work for Google. Facebook, Twitter and GitHub do not provide the ability to pass a similar field. Though, in general, providing the ability to specify custom OAuth parameters in the config, is a good idea.
I think this is a good idea, we could pass the login_hint containing the user's email address when the user has the view asking them to sign in with Google. @bojeil-google, I don't think this would be covered with custom OAuth parameters in the config, as the application doesn't know at that point which email the user will use.
Yeah I know. I didn't mean it for this special case. I am saying in general we should provide the developer with the ability to configure custom OAuth parameters per providers. In this case we could have special logic to pass login_hint to ensure the user logs in using the correct Google account.
Thanks. I think it's fine that it's only for Google.. AFAIK GitHub/Facebook/Twitter have less support for multiple accounts & would normally proceed assuming the user is using their currently-signed-in account.
I merged a PR to fix this issue. When Google OAuth flow is triggered and the email is known, the login_hint will be set to that email in the Google provider object. Will push a patch update when i get the chance.
Most helpful comment
I merged a PR to fix this issue. When Google OAuth flow is triggered and the email is known, the login_hint will be set to that email in the Google provider object. Will push a patch update when i get the chance.