Created
October 18, 2020 04:50
-
-
Save johnkingzy/a3dac0640d43fbd2fc25c59befbf39e9 to your computer and use it in GitHub Desktop.
Firebase/Firestore useful snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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