firebase / firebase/firebase-admin-node

[FR] Auth: Update user details and custom claims in the same request

Đang mở
#1,876 2 bình luận 2 reaction 1 người được giao Được @prameshj nhận Xem trên GitHub
api: auth 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ả

Currently, the custome user claims can be updated with [`setCustomUserClaims()`](https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.baseauth.md#baseauthsetcustomuserclaims), and the user details can be updated with [`updateUser()`](https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.baseauth.md#baseauthupdateuser).

Both use same [`/accounts:update`](https://cloud.google.com/identity-platform/docs/reference/rest/v1/accounts/update) REST API under the hood.

Is there a particular reason why the `updateUser()` method does not allow updating the custom claims even though it is possible in the underlying REST API? A follow up point is: if the `updateUser()` method has this functionalitly, then the `setCustomUserClaims()` would become obsolete (just a convenience wrapper).

I'd like to be able to include a `customClaims` field in the [`UpdateRequest`](https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.updaterequest.md#updaterequest_interface) interface, so that, if needed, we can update the user's details and claims in a single request. Currently we need two separate network requests to do this.

Let me know, and I can help with a PR if you want.

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.