Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete firebase account when user data is deleted on flutter?

is it possible to delete firebase account in authentication on flutter? if yes, how to do that? I have been search but not found the way.

Firestore.instance.collection("users").document(uid).delete().then((_){
   // delete account on authentication after user data on database is deleted            
});
like image 731
Ashtav Avatar asked Jun 04 '19 02:06

Ashtav


1 Answers

Code for deleting user:

FirebaseUser user = await FirebaseAuth.instance.currentUser();
user.delete();

like image 164
Austris Cirulnieks Avatar answered Oct 03 '22 17:10

Austris Cirulnieks