piotrpawlowski
piotrpawlowski

Reputation: 796

Deleting account in Firebase on Android

when I try to delete account in Firebase with FirebaseUser#delete() method in Firebase Android SDK I receive FirebaseException. An internal error has occurred. [ CREDENTIAL_TOO_OLD_LOGIN_AGAIN ] instead of FirebaseAuthRecentLoginRequiredException that is descriped here: https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser.html#delete(). It is hard to develop with because FirebaseException has no method to fetch an error code. Version of Firebase SDK: 11.4.2. Is it a bug or I missed something?

Upvotes: 2

Views: 977

Answers (1)

Himanshu Rawat
Himanshu Rawat

Reputation: 677

user.delete(); the method will only work when a user has signed in recently. If credentials are older than the certain threshold then this method will not allow deletion of the user from Firebase. You can overcome this by signing out and then sign in and then delete the user. You require new credentials for reauthenticate(); method. I hope it helps.

Upvotes: 1

Related Questions