firebase / firebase/firebase-admin-node

[FR] Auth: Provide an API to create/update users without unneeded API requests

未关闭
#1,885 3 条评论 1 个 reaction 已指派 2 人 已被 @prameshj 认领 在 GitHub 查看
api: auth help wanted type: feature request
主要语言
TypeScript
星标
1.7k
派生
419
平均合并
3 天 10 小时
30 天内合并 PR
16

描述

The [`updateUser()`](https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.baseauth.md#baseauthupdateuser) and [`createUser()`](https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.baseauth.md#baseauthcreateuser) methods always perform two API requests under the hood: (1) the create/update request, and (2) a subsequent [`getUser()`](https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.baseauth.md#baseauthgetuser) request.

In latency-sensitive applications where the result of `getUser()` is not required, this means an extra un-needed sequential round-trip network request. This fact is not apparent from the API or documentation.

### Proposal

Add a second, optional parameter to `createUser()` and `updateUser()` called something like `noFetchUserRecord` which defaults to `false` (existing behaviour). If `true`, the `getUser()` request will be skipped, and the function will return `Promise`, avoiding the un-needed round-trip request.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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