mirror of https://github.com/jumpserver/jumpserver
fix: Add third party login check is block (#15916)
Co-authored-by: wangruidong <940853815@qq.com>pull/15919/head
parent
6d6dec2752
commit
e6d02eaf4c
|
@ -77,6 +77,7 @@ class ThirdPartyLoginMiddleware(mixins.AuthMixin):
|
||||||
ip = get_request_ip(request)
|
ip = get_request_ip(request)
|
||||||
try:
|
try:
|
||||||
self.request = request
|
self.request = request
|
||||||
|
self.check_is_block()
|
||||||
self._check_third_party_login_acl()
|
self._check_third_party_login_acl()
|
||||||
self._check_login_acl(request.user, ip)
|
self._check_login_acl(request.user, ip)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -125,7 +125,7 @@ class BlockUtilBase:
|
||||||
BLOCK_KEY_TMPL: str
|
BLOCK_KEY_TMPL: str
|
||||||
|
|
||||||
def __init__(self, username, ip):
|
def __init__(self, username, ip):
|
||||||
self.username = username
|
username = username.lower() if username else ''
|
||||||
self.ip = ip
|
self.ip = ip
|
||||||
self.limit_key = self.LIMIT_KEY_TMPL.format(username, ip)
|
self.limit_key = self.LIMIT_KEY_TMPL.format(username, ip)
|
||||||
self.block_key = self.BLOCK_KEY_TMPL.format(username)
|
self.block_key = self.BLOCK_KEY_TMPL.format(username)
|
||||||
|
|
Loading…
Reference in New Issue