fix: Add third party login check is block

This commit is contained in:
wangruidong 2025-07-11 15:19:56 +08:00 committed by Bryan
parent c7dcf1ba59
commit accde77307
2 changed files with 3 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class MFAMiddleware:
# 这个是 mfa 登录页需要的请求, 也得放出来, 用户其实已经在 CAS/OIDC 中完成登录了
white_urls = [
'login/mfa', 'mfa/select', 'face/context','jsi18n/', '/static/',
'login/mfa', 'mfa/select', 'face/context', 'jsi18n/', '/static/',
'/profile/otp', '/logout/',
]
for url in white_urls:
@ -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:

View File

@ -161,7 +161,7 @@ class BlockUtilBase:
BLOCK_KEY_TMPL: str
def __init__(self, username, ip):
username = username.lower()
username = username.lower() if username else ''
self.username = username
self.ip = ip
self.limit_key = self.LIMIT_KEY_TMPL.format(username, ip)