简体   繁体   English

如何使用Firebase验证电子邮件地址

[英]How to validate Email address using Firebase

I'm doing a two step sign up process. 我正在做两步注册过程。 First email, then password. 第一封电邮,然后是密码。

I'd like to validate if the email is not in use or badly formatted first. 我想先验证电子邮件是否未被使用或格式错误。 If it's ok, then show the password form. 如果没问题,请显示密码表格。

Right now I can't find a good way to verify if the email is used. 现在我找不到验证电子邮件是否被使用的好方法。

I'd expect something like this: 我期待这样的事情:

 firebaseAuth.validateEmailAddress(email)

You can check if an email is in use by checking if fetchProvidersForEmail returns an empty array. 您可以通过检查fetchProvidersForEmail是否返回空数组来检查是否正在使用电子邮件。

https://firebase.google.com/docs/reference/js/firebase.auth.Auth#fetchProvidersForEmail https://firebase.google.com/docs/reference/js/firebase.auth.Auth#fetchProvidersForEmail

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM