firebase / firebase/firebase-admin-node

deleteUsers(uids: string[]) Not Working

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

`deleteUsers` is only deleting the first entry of the provided array of `uid`, see the following:

- Relevant code snippet:

```js
--- SNIP ---
if (httpMethod === "DELETE") {
const { id } = event.queryStringParameters;
if (!id) return handleError(new Error("Please provide an id."), 405);

const uids = id.split(",");
return handleDeleteRequest(tenantAuth, uids);
}
--- SNIP ---

const handleDeleteRequest = async (tenantAuth, uids) => {
try {
console.log("handleDeleteRequest -> uids:", uids);
const deleteUserResults = await tenantAuth.deleteUsers(uids);

return {
body: JSON.stringify({ results: deleteUserResults }),
headers: { "Content-Type": "application/json" },
statusCode: 200,
};
} catch (error) {
return handleError(error);
}
};
```

- `uids` value:

```
handleDeleteRequest -> uids: [ 'cbHxLH4TtKN8tREDACTED', ' PLrrHeqlphcHP1REDACTED' ]
Response with status 200 in 855 ms.
```

- Server's response:

`{"results":{"failureCount":0,"successCount":2,"errors":[]}}`

Although success count shows 2 when going to the console only the first user is deleted. It seems that this function is buggy...

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.