Skip to content

Instantly share code, notes, and snippets.

@johnkingzy
Created October 18, 2020 04:50
Show Gist options
  • Save johnkingzy/a3dac0640d43fbd2fc25c59befbf39e9 to your computer and use it in GitHub Desktop.
Save johnkingzy/a3dac0640d43fbd2fc25c59befbf39e9 to your computer and use it in GitHub Desktop.
Firebase/Firestore useful snippets
// delete all users from the auth console
module.exports.deleteUsers = async (req, res) => {
return admin
.auth()
.listUsers()
.then((result) => {
const markedForDelete = [];
result.users.forEach((user) => {
markedForDelete.push(user.uid);
});
return admin.auth().deleteUsers(markedForDelete);
})
.catch((error) => error);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment