firebase / firebase/firebase-admin-node

GetUserByEmail and/or getUsers should return all users[FR]

未关闭
#2,430 7 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
needs-triage type: feature request
主要语言
TypeScript
星标
1.7k
派生
419
平均合并
3 天 10 小时
30 天内合并 PR
16

描述

**Is your feature request related to a problem? Yes**
It is very hard to search all the users by email when you allow the user to link multiple providers or if you allow multiple accounts with the same email.

**Describe the solution you'd like**
- The function "getUserByEmail" should return the first user that find where the email matches any of the emails found in its providers.
- The function "getUsers" should return a list of all the users that match that email in any of its providers.

**Describe alternatives you've considered**
We've been using a property to store the email as a record with the user data in firestore. But if you have any bug in any of your versions that list will break. It even becomes harder when you allow for multiple accounts and multiple provider linking in the same account.

We've consider using auth triggers in functions to keep that list updated, but there are no triggers when a user updates their auth credentials.

**Additional context**
Also as the feature "fetchSignInForEmail" and others like it are being removed for security purposes this feature is going to become even more useful and needed, and the admin is the perfect place to do it.

Also this is the behavior you get when searching for an email in the firebase auth panel.

Thank you very much for the great work. If I can help in any way I'll be happy to :)
Hope you have a great day.

贡献指南

打开贡献指南

调研方向

首先定位 Admin Auth 中 getUserByEmail 和 getUsers 的实现,然后检查当前如何匹配 provider 的电子邮件。将它们的行为与 issue 中描述的 Firebase Auth 面板行为进行比较。当 getUserByEmail 返回第一个匹配的用户,并且 getUsers 返回跨所有 provider 与该电子邮件匹配的每个用户,同时测试覆盖多个 provider 和重复账户时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
node.js, typescript
领域
authentication, backend-api-design
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。