I'm trying to run a script that will mark anonymous users with a flag in firestore. For that I'm getting all firebase auth users with firebase-admin's auth listUsers
. But I'm not sure how to identify whether a user has an actual account using one of the providers or just signed-in anonymously. Via a firebase auth dashboard it's easy to see who is anonymous but not sure how to get that in code.
UserRecord
objects returned from listUsers()
have providerData
array field. Each element has providerId
So, my guess is I should somehow filter that based on whether a user has only one provider which is anonymous. Question is what is the providerId
for anonymous auth? Didn't manage to find that in docs.