From e6d02eaf4ce0bf4a5a617d5e1d10f7a35936c630 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 25 Aug 2025 10:51:42 +0800 Subject: [PATCH] fix: Add third party login check is block (#15916) Co-authored-by: wangruidong <940853815@qq.com> --- apps/authentication/middleware.py | 1 + apps/users/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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)