[英]Firebase Auth incorrect Error after Google Signin
If I create a Test User using an gmail email and password on Firebase Auth using signInWithEmailAndPassword
. 如果我使用
signInWithEmailAndPassword
在Firebase Auth上使用gmail电子邮件和密码来创建测试用户。 and then on a next visit sign in using Google Sign in with the same gmail email using signInWithPopup(provider)
. 然后在下次访问时,使用
signInWithPopup(provider)
和相同的gmail电子邮件登录使用Google登录。 Then on the next visit I try to sign in with the same email using signInWithEmailAndPassword
I get an error code that the 然后在下一次访问时,我尝试使用
signInWithEmailAndPassword
使用相同的电子邮件登录,但收到错误代码,
password is incorrect
密码错误
Shouldn't the correct error code that handles the case where the email is linked to the google Provider so I can prompt user to sign in with google instead of trying to input email and password. 不应使用正确的错误代码来处理将电子邮件链接到google Provider的情况,因此我可以提示用户使用google登录,而不是尝试输入电子邮件和密码。 Or trying to reset a password.
或尝试重设密码。
If you create an email/password user and then sign in with a Google user, the Google account will overwrite the email/password account (assuming it is not verified). 如果您创建了一个电子邮件/密码用户,然后以Google用户身份登录,则Google帐户将覆盖该电子邮件/密码帐户(假设未验证)。 This is for security reasons, as anyone can create an unverified email/password account, possibly claiming another user's email.
这是出于安全原因,因为任何人都可以创建未经验证的电子邮件/密码帐户,并可能要求其他用户的电子邮件。 Firebase Overwrites Signin with Google Account
Firebase使用Google帐户覆盖登录
If you want to link a Google account to an email account, you can first sign in the user with Google and then currentUser.updatePassword
to add a password. 如果要将Google帐户链接到电子邮件帐户,则可以先使用Google登录用户,然后再使用
currentUser.updatePassword
来添加密码。 The next the user can sign in with Google or email/password. 接下来,用户可以使用Google或电子邮件/密码登录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.