pythonfirebase-authenticationfirebase-adminpyrebase

Disable user account after firebase authentication time period


I would like to set a period to automatically deactivate users. Example: after 7 days disable user x Or a way to register user with default disabled true

I'm currently registering this way using pyrebase and pyqt5

def register(self, screen):
        email = screen.email.text()
        password = screen.password.text()
        confirmpass = screen.confirmpass.text()
        if password == confirmpass:
            try:
                self.auth.create_user_with_email_and_password(email, password)
                self.msg_error_registro(screen, msg="Registration successful", bgcolor="background-color:rgb(85, 255, 127);")
                screen.email.setText("")
                screen.password.setText("")
                screen.confirmpass.setText("")
            except requests.exceptions.HTTPError as httpErr:
                self.error_message = json.loads(httpErr.args[1])['error']['message']

Solution

  • There is nothing built into Firebase Authentication to automatically disable accounts after a certain amount of time. I also don't see a call in Pyrebase to set the disabled flag of a user account, even though it is certainly possible to do so through the REST API that Pyrebase wraps.

    Did you consider using the Firebase Admin SDK for Python, which does support disabling accounts and many more operations?