firebase / firebase/firebase-admin-node

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

Đang mở
#1,885 3 bình luận 1 reaction 2 người được giao Được @prameshj nhận Xem trên GitHub
api: auth help wanted type: feature request
Ngôn ngữ chính
TypeScript
Star
1.7k
Fork
419
Merge trung bình
3 ngày 10 giờ
Pull request đã merge (30 ngày)
16

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.