mirror of https://github.com/jumpserver/jumpserver
fix: 工单拒绝清除mfa
parent
d49d1ba055
commit
f762fe73ff
|
@ -362,6 +362,12 @@ class AuthMixin(PasswordEncryptionViewMixin):
|
||||||
self.request.session['auth_mfa_required'] = ''
|
self.request.session['auth_mfa_required'] = ''
|
||||||
self.request.session['auth_mfa_type'] = mfa_type
|
self.request.session['auth_mfa_type'] = mfa_type
|
||||||
|
|
||||||
|
def clean_mfa_mark(self):
|
||||||
|
self.request.session['auth_mfa'] = ''
|
||||||
|
self.request.session['auth_mfa_time'] = ''
|
||||||
|
self.request.session['auth_mfa_required'] = ''
|
||||||
|
self.request.session['auth_mfa_type'] = ''
|
||||||
|
|
||||||
def check_mfa_is_block(self, username, ip, raise_exception=True):
|
def check_mfa_is_block(self, username, ip, raise_exception=True):
|
||||||
if MFABlockUtils(username, ip).is_block():
|
if MFABlockUtils(username, ip).is_block():
|
||||||
logger.warn('Ip was blocked' + ': ' + username + ':' + ip)
|
logger.warn('Ip was blocked' + ': ' + username + ':' + ip)
|
||||||
|
@ -413,10 +419,12 @@ class AuthMixin(PasswordEncryptionViewMixin):
|
||||||
self.request.session["auth_confirm"] = "1"
|
self.request.session["auth_confirm"] = "1"
|
||||||
return
|
return
|
||||||
elif ticket.state_reject:
|
elif ticket.state_reject:
|
||||||
|
self.clean_mfa_mark()
|
||||||
raise errors.LoginConfirmOtherError(
|
raise errors.LoginConfirmOtherError(
|
||||||
ticket.id, ticket.get_state_display()
|
ticket.id, ticket.get_state_display()
|
||||||
)
|
)
|
||||||
elif ticket.state_close:
|
elif ticket.state_close:
|
||||||
|
self.clean_mfa_mark()
|
||||||
raise errors.LoginConfirmOtherError(
|
raise errors.LoginConfirmOtherError(
|
||||||
ticket.id, ticket.get_state_display()
|
ticket.id, ticket.get_state_display()
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue