登录序列仅以电子邮件地址开头。
如果地址已注册到Firebase,则登录将继续。
如果未添加,将创建一个新帐户。
How can I check an email address that has been registered or not on the firebase auth, as the firebaseui does it? I'm looking for the appropriate API to check the email address if it has been added or not. I've searched on the document firebase. auth. Auth, but I can't find it. I've tried the firebase.auth().signInWithEmailAndPassword(this.email, "")
with expect to get the error auth/user-not-found, but I've get auth/wrong-password.
You can use the following method, from the docs:
fetchSignInMethodsForEmail
fetchSignInMethodsForEmail(email: string): Promise<Array<string>>
Gets the list of possible sign in methods for the given email address. This is useful to differentiate methods of sign-in for the same provider, eg. EmailAuthProvider which has 2 methods of sign-in, email/password and email/link.
Error Codes
auth/invalid-email Thrown if the email address is not valid.
参量
email: string
Returns Promise<Array<string>>
如果电子邮件未注册,这将返回错误
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句