From a28239f313d5ec024530278b9e0d85d786ecba5b Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 18 Apr 2023 18:07:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=99=BB=E5=BD=95=E5=A4=8D=E6=A0=B8?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=90=8E404=20(#10240)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng <1304903146@qq.com> --- apps/authentication/api/login_confirm.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/authentication/api/login_confirm.py b/apps/authentication/api/login_confirm.py index d2e5eb14e..7802b5b34 100644 --- a/apps/authentication/api/login_confirm.py +++ b/apps/authentication/api/login_confirm.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- # +from django.contrib.auth import logout as auth_logout +from rest_framework.permissions import AllowAny from rest_framework.response import Response from rest_framework.views import APIView -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__) @@ -26,8 +25,10 @@ class TicketStatusApi(mixins.AuthMixin, APIView): reason = e.msg username = e.username self.send_auth_signal(success=False, username=username, reason=reason) + auth_ticket_id = request.session.pop('auth_ticket_id', '') # 若为三方登录,此时应退出登录 auth_logout(request) + request.session['auth_ticket_id'] = auth_ticket_id return Response(e.as_data(), status=200) except errors.NeedMoreInfoError as e: return Response(e.as_data(), status=200)