Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete auth user in firebase react native

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

like image 291
H. Sayouf Avatar asked Sep 08 '25 13:09

H. Sayouf


2 Answers

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));
like image 179
Abílio Soares Coelho Avatar answered Sep 10 '25 03:09

Abílio Soares Coelho


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
// ...
});
like image 39
H. Sayouf Avatar answered Sep 10 '25 03:09

H. Sayouf