Revokes the refresh token and all access tokens that were generated using it.

def revoke_tokens(self):
        """
        Revokes the refresh token and all access tokens that were generated using it.
        """

        self.is_active = False
        self.save()

        for access_token in self.access_tokens.all():
            access_token.revoke()