fix: 用户登录复合500 (#8743)

Co-authored-by: feng626 <1304903146@qq.com>
This commit is contained in:
fit2bot
2022-08-15 16:21:27 +08:00
committed by GitHub
parent 9a4b32cb3c
commit 5559f112db
3 changed files with 15 additions and 3 deletions

View File

@@ -22,7 +22,10 @@ class TicketStatusApi(mixins.AuthMixin, APIView):
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'))
reason = e.msg
username = e.username
self.send_auth_signal(success=False, username=username, reason=reason)
# 若为三方登录,此时应退出登录
auth_logout(request)
return Response(e.as_data(), status=200)
except errors.NeedMoreInfoError as e: