firebase / firebase/firebase-admin-node

deleteUsers(uids: string[]) Not Working

オープン
#2,419 コメント 1 件 リアクション 0 件 担当者 1 名 @pragatimodi が担当を希望しています GitHub で見る
api: auth
主要言語
TypeScript
スター
1.7k
フォーク
419
平均マージ
3日 10時間
マージ済み PR(30日)
16

説明

`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...

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。