From 18af5e8c4a2ddceef89ff315a159729f00be551e Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Fri, 12 Aug 2022 18:01:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=80=90=E7=99=BB=E5=BD=95=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E3=80=91=E7=99=BB=E5=BD=95=E5=A4=8D=E6=A0=B8=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=A2=AB=E6=8B=92=E7=BB=9D=EF=BC=8C=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=97=A0=E7=99=BB=E5=BD=95=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E3=80=91=20(#8739)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 【登录】第三方用户登录复核,拒绝状态,未真正拦截 * fix: 【登录日志】登录复核用户被拒绝,登录日志无登录日志记录】 * fix: 【登录日志】用户设置登录复核,登录。此时不处理工单,管理员全局组织下查看登录日志,日志无限新增,且无记录用户名】 Co-authored-by: huangzhiwen --- apps/authentication/api/login_confirm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/authentication/api/login_confirm.py b/apps/authentication/api/login_confirm.py index 71613348c..5bddda4e3 100644 --- a/apps/authentication/api/login_confirm.py +++ b/apps/authentication/api/login_confirm.py @@ -6,6 +6,8 @@ from rest_framework.permissions import AllowAny from common.utils import get_logger from .. import errors, mixins +from django.contrib.auth import logout as auth_logout + __all__ = ['TicketStatusApi'] logger = get_logger(__name__) @@ -19,8 +21,11 @@ class TicketStatusApi(mixins.AuthMixin, APIView): self.check_user_login_confirm() self.request.session['auth_third_party_done'] = 1 return Response({"msg": "ok"}) + except errors.LoginConfirmOtherError as e: + self.send_auth_signal(success=False, user=request.user, username=request.user.name, reason=e.as_data().get('msg')) + auth_logout(request) + return Response(e.as_data(), status=200) except errors.NeedMoreInfoError as e: - self.send_auth_signal(success=False, reason=e.as_data().get('msg')) return Response(e.as_data(), status=200) def delete(self, request, *args, **kwargs):