Skip to content
Advertisement

Delete user using firebase Admin SDK

How do I delete a user from my admin panel using the firebase Admin SDK? I’m getting this error when trying to delete it:

Uncaught (in promise) ReferenceError: uid is not defined at eval (ManageCustomer.vue?b113:262)

What am I doing wrong?

This is my code in index.js from functions

JavaScript

Here is my client side code

JavaScript

Advertisement

Answer

You are not accessing the UID in your cloud function from the data object.

JavaScript

Also try passing the UID from Vue app in an object as shown in the documentation.

JavaScript

However, the issue is on your frontend. Where is uid defined? In the example above I have hard coded it, make sure you fetch the UID from your input field if it is an admin that is trying to delete user.

Is the doc.id the UID of user to be deleted? If yes, then you should call function like this deleteUser(doc.id)

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement