Open g-viet opened 6 years ago
Note:
QUOTA EXCEED of deleting authenticated Users has been limited: 10 requests per second.
const clearAuthUsers: any = async (auth: auth.Auth, remainingUsers?: auth.UserRecord[]) => { return await auth.listUsers().then(userList => { const shouldDeleteUsers = remainingUsers ? remainingUsers.slice(0, 9) : userList.users.slice(0, 9); remainingUsers = remainingUsers ? remainingUsers.slice(10, -1) : userList.users.slice(10, -1); const deleteUserTasks = shouldDeleteUsers.map(user => auth.deleteUser(user.uid)); return Promise.all(deleteUserTasks) .then(() => { if (remainingUsers.length === 0) return null; return setTimeout(() => { return clearAuthUsers(auth, remainingUsers); }, 1000); }); }); };
Note:
QUOTA EXCEED of deleting authenticated Users has been limited: 10 requests per second.