@sanvika/auth 2.5.6 → 2.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.js +16 -0
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -255,9 +255,25 @@ async function createAdminInAuth(payload, authToken = "") {
|
|
|
255
255
|
return null;
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
+
async function deleteAdminFromAuth(uid, authToken = "") {
|
|
259
|
+
try {
|
|
260
|
+
const res = await fetch(`${_authUrl()}/api/admin/admin-users/${encodeURIComponent(uid)}`, {
|
|
261
|
+
method: "DELETE",
|
|
262
|
+
headers: {
|
|
263
|
+
..._s2sHeaders(),
|
|
264
|
+
...authToken ? { Authorization: `Bearer ${authToken}` } : {}
|
|
265
|
+
},
|
|
266
|
+
signal: AbortSignal.timeout(5e3)
|
|
267
|
+
});
|
|
268
|
+
return res.ok;
|
|
269
|
+
} catch {
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
258
273
|
export {
|
|
259
274
|
batchGetUsersFromAuth,
|
|
260
275
|
createAdminInAuth,
|
|
276
|
+
deleteAdminFromAuth,
|
|
261
277
|
deleteUserFromAuth,
|
|
262
278
|
ensureSuperAdminInAuth,
|
|
263
279
|
extractAuthUid,
|