Reputation: 237
I was wondering if there was a way to delete a user from FirebaseAuth by their UID. Upon my research online, it seems like you can only delete the current logged in user.
Please advise if this is a possibility.
Upvotes: 2
Views: 1011
Reputation: 317372
A user signed in can only delete their own account. No user has ability or permission to delete another account from your client web or mobile app, not matter what platform. That would actually be a huge security hole.
What you can do instead is delete the user from a backend you control using the Firebase Admin SDK, which has the ability to manage users. Privileged backend code can delete any user by UID. If you intend for your end users to invoke some function on your backend that deletes another user, you should verify in your backend code that the user should have this privilege.
Upvotes: 6