diff --git a/apps/authentication/middleware.py b/apps/authentication/middleware.py index d1f3b087b..5b7f2fe5e 100644 --- a/apps/authentication/middleware.py +++ b/apps/authentication/middleware.py @@ -77,6 +77,7 @@ class ThirdPartyLoginMiddleware(mixins.AuthMixin): ip = get_request_ip(request) try: self.request = request + self.check_is_block() self._check_third_party_login_acl() self._check_login_acl(request.user, ip) except Exception as e: diff --git a/apps/users/utils.py b/apps/users/utils.py index bb9877a70..1119eb9ab 100644 --- a/apps/users/utils.py +++ b/apps/users/utils.py @@ -125,7 +125,7 @@ class BlockUtilBase: BLOCK_KEY_TMPL: str def __init__(self, username, ip): - self.username = username + username = username.lower() if username else '' self.ip = ip self.limit_key = self.LIMIT_KEY_TMPL.format(username, ip) self.block_key = self.BLOCK_KEY_TMPL.format(username)