Previously, when deleting data from Firebase, I used the following code:
MyFirebaseRef.on('child_removed', function (oldChildSnapshot) {
/* oldChildSnapshot => the data that's been erased */
});
Now, however, I want to achieve the same effect when removing a user, specifically accessing the user-related data, such as the UID. I've attempted the following approach:
MyFirebaseRef.removeUser({
email: "EMAIL",
password: "PASSWORD"
}, function (error, authData) {
if (error === null) {
console.log("User removed successfully", authData.uid);
} else {
console.log("Error removing user:", error);
}
}
});
Unfortunately, authData
is undefined
, making it impossible to retrieve the UID. Is there a way to accomplish this task?