E
E
evg_962018-03-02 07:00:50
React
evg_96, 2018-03-02 07:00:50

How to remove user from firebase by uid?

In the documentation, I found a method for deleting the current user. And how to delete an arbitrary user by his uid?

var user = firebase.auth().currentUser;

user.delete().then(function() {
  // User deleted.
}).catch(function(error) {
  // An error happened.
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kalibrov, 2018-03-02
@rework

You need to use the Admin SDK - https://firebase.google.com/docs/auth/admin/manage... (this feature only appeared not so long ago), code example:

admin.auth().deleteUser(uid)
  .then(function() {
    console.log("Successfully deleted user");
  })
  .catch(function(error) {
    console.log("Error deleting user:", error);
  });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question