fix: 登录复核刷新后404 (#10240)

Co-authored-by: feng <1304903146@qq.com>
pull/10244/head
fit2bot 2 years ago committed by GitHub
parent 996690fc02
commit a28239f313
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,13 +1,12 @@
# -*- coding: utf-8 -*- # -*- 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.response import Response
from rest_framework.views import APIView from rest_framework.views import APIView
from rest_framework.permissions import AllowAny
from common.utils import get_logger from common.utils import get_logger
from .. import errors, mixins from .. import errors, mixins
from django.contrib.auth import logout as auth_logout
__all__ = ['TicketStatusApi'] __all__ = ['TicketStatusApi']
logger = get_logger(__name__) logger = get_logger(__name__)
@ -26,8 +25,10 @@ class TicketStatusApi(mixins.AuthMixin, APIView):
reason = e.msg reason = e.msg
username = e.username username = e.username
self.send_auth_signal(success=False, username=username, reason=reason) self.send_auth_signal(success=False, username=username, reason=reason)
auth_ticket_id = request.session.pop('auth_ticket_id', '')
# 若为三方登录,此时应退出登录 # 若为三方登录,此时应退出登录
auth_logout(request) auth_logout(request)
request.session['auth_ticket_id'] = auth_ticket_id
return Response(e.as_data(), status=200) return Response(e.as_data(), status=200)
except errors.NeedMoreInfoError as e: except errors.NeedMoreInfoError as e:
return Response(e.as_data(), status=200) return Response(e.as_data(), status=200)

Loading…
Cancel
Save