Delete auth user in firebase react native

Viewed 1461

I am trying to delete auth user from firebase with email or uid. I searched on google but I did not find any solution.

3 Answers

I found this method, but this deletes current user, I want to delete the specific user.

import { getAuth, deleteUser } from "firebase/auth";

const auth = getAuth();
const user = auth.currentUser;

deleteUser(user).then(() => {
// User deleted.
}).catch((error) => {
// An error ocurred
// ...
});

For React Native

import auth from "@react-native-firebase/auth";

 let user = auth().currentUser;
    user
      .delete()
      .then(() => console.log("User deleted"))
      .catch((error) => console.log(error));
Related