firebase delete user
const listAllUsers = async (nextPageToken?: string) => {
const res = await firebase.auth().listUsers(1000, nextPageToken);
const users = res.users.filter(u => u.email?.includes('gmail.com'));
users.forEach(x => {
firebase
.auth()
.deleteUser(x.uid)
.then(() => {
console.log(`Successfully deleted user ${x.email}`);
})
.catch(error => {
console.log('Error deleting user:', error);
});
});
return users;
};