So I know in Firebase Flutter there is the method User?.delete()
which deletes the current logged in user. But I'm building an Admin Menu in which he can delete any of the users not only the current one.
I found a method in here that basically signs in the user using firebaseAuth.signInWithCredential()
but this only works with the email and password provider. But it doesn't work with the google signed In ones.
A solution I came up with is that I delete the users documents
in FireStore
and add a condition in the log in page that states if the user doesn't have a document then don't let him in. And even though it works I'm looking for another one that is more practical.
With that said, is there any method that can delete the user using only he's email regardless of his AuthProvider?