简体   繁体   English

在Android上的Firebase中删除帐户

[英]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 ] 当我尝试在Firebase Android SDK中使用FirebaseUser#delete()方法FirebaseUser#delete() Firebase中的帐户时,收到FirebaseException. An internal error has occurred. [ CREDENTIAL_TOO_OLD_LOGIN_AGAIN ] FirebaseException. An internal error has occurred. [ CREDENTIAL_TOO_OLD_LOGIN_AGAIN ] 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() . FirebaseException. An internal error has occurred. [ CREDENTIAL_TOO_OLD_LOGIN_AGAIN ]代替了此处描述的FirebaseAuthRecentLoginRequiredExceptionhttps : //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. 很难开发,因为FirebaseException没有方法来获取错误代码。 Version of Firebase SDK: 11.4.2. Firebase SDK的版本:11.4.2。 Is it a bug or I missed something? 是错误还是我错过了什么?

user.delete(); 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. 如果凭据早于特定阈值,则此方法将不允许从Firebase中删除用户。 You can overcome this by signing out and then sign in and then delete the user. 您可以通过注销然后登录然后删除用户来解决此问题。 You require new credentials for reauthenticate(); 您需要新的凭据才能进行reauthenticate(); method. 方法。 I hope it helps. 希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM