如何查看电子邮件是否已经通过Firebase简单登录注册? [英] How to find out if an email is already registered with Firebase Simple Login?
问题描述
更新6/26/2016
自从最初发布以来,已经发生了很多变化,Firebase身份验证不再被称为Firebase简单登录。
此外,它看起来像一个新的方法可用 fetchProvidersForEmail
可能提供解决此问题。
fetchProvidersForEmail(email)返回firebase.Promise包含非空字符串Array
获取可用于登录给定电子邮件地址的提供者ID的列表。用于标识优先登录流程。
我没有测试过这个,但是我想象一下,方法,并接收提供者数组,然后电子邮件必须已经注册一个或多个身份验证提供程序。
$ b 旧答复
我不相信您可以直接查询Firebase简单登录信息,而无需尝试实际登录用户或注册用户。
您需要做的是在注册过程中存储已注册的电子邮件列表,然后查询该列表。那么你可以查询这个路径,如果它返回的数据,它存在,否则它不会。
I am using firebase (with Angularfire) for an html5 phone app. The user inputs only their email in the start screen, and then, depending on whether that email is already registered or not, the user is redirected to the login or registration page, respectively. For step1, how can we query the firebase simple login to determine if the email is registered or not?
Update 6/26/2016
A lot has changed since this was originally posted, Firebase Authentication is no longer called Firebase Simple Login.
Additionally, it looks like a new method is available fetchProvidersForEmail
which might provide a solution to this problem.
From the docs:
fetchProvidersForEmail(email) returns firebase.Promise containing non-null Array of string
Gets the list of provider IDs that can be used to sign in for the given email address. Useful for an "identifier-first" sign-in flow.
I have not tested this but I'd imagine if you call that method and receive an array of providers then the e-mail must already be registered with one or more authentication providers.
Old Answer
I don't believe you can query the Firebase Simple Login directly for that information without either trying to actually login the user or register them.
What you'd need to do is store a list of registered e-mails during your registration process and query that list instead. Then you can query that path and if it comes back with data, it exists, otherwise it doesn't.
这篇关于如何查看电子邮件是否已经通过Firebase简单登录注册?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!