Created
June 8, 2022 06:54
-
-
Save gupta-shrinath/a610eb47f1e0f35c35c7b13f0976448d to your computer and use it in GitHub Desktop.
Delete all anonymous firebase users
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
import firebase_admin | |
from firebase_admin import credentials | |
from firebase_admin import firestore | |
from firebase_admin import auth | |
# Download the service account json from Project Setting > Service Accounts Generate Private Key | |
service_account = 'project.json' | |
cred = credentials.Certificate(service_account) | |
firebase_admin.initialize_app(cred) | |
for user in auth.list_users().iterate_all(): | |
if user.email is None and user.phone_number is None: | |
auth.delete_user(user.uid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment