Disabling or deleting a user account does not change the state of the user. It also does not need to be authenticated. Within no more than an hour, Firebase Authentication will attempt to update the access token for the user. This update will fail, at which point the user will become unauthenticated and an auth state change event will occur.
If you want to immediately revoke user authorization, you will have to do this in another part of your application logic. A common way to do this is to have a blacklist in your application, for example. in Firebase Database :
/bannedUsers uidOfBannedUser: true
Now, when you delete / deactivate a user account in the Autentication panel, you also add your uid to the list of denied users in the database.
Then the database can be protected from access from unauthorized users by adding an offer to the database security rules , for example
{ "rules": { "bannedUsers": { ".read": true, ".write": false // only admins can write these }, "messages": { ".read": "auth != null && !root.child('bannedUsers').child(auth.uid).exists()" } } }
If you use a different back-end, the implementation will be different. But a blacklist like this is a common approach to ban users. You will find that you may even have a little bit about their authentication, that you forbid them, and do not delete their credentials (which they can simply recreate).
source share