From f596b65ed7e54446abde1df247888bdfce636998 Mon Sep 17 00:00:00 2001 From: xinwen Date: Mon, 28 Sep 2020 11:13:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(auth):=20sso=20=E7=94=9F=E6=88=90=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E9=87=8D=E5=A4=8D=E8=AE=BF=E9=97=AE=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E9=87=8D=E5=AE=9A=E5=90=91=E5=88=B0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=8C=87=E5=AE=9A=E7=9A=84=20next=20?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/api/sso.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/authentication/api/sso.py b/apps/authentication/api/sso.py index b953b8d37..1b0a9fa25 100644 --- a/apps/authentication/api/sso.py +++ b/apps/authentication/api/sso.py @@ -73,12 +73,12 @@ class SSOViewSet(AuthMixin, JmsGenericViewSet): token.save() except (ValueError, SSOToken.DoesNotExist): self.send_auth_signal(success=False, reason='authkey_invalid') - return HttpResponseRedirect(reverse('authentication:login')) + return HttpResponseRedirect(next_url) # 判断是否过期 if (utcnow().timestamp() - token.date_created.timestamp()) > settings.AUTH_SSO_AUTHKEY_TTL: self.send_auth_signal(success=False, reason='authkey_timeout') - return HttpResponseRedirect(reverse('authentication:login')) + return HttpResponseRedirect(next_url) user = token.user login(self.request, user, 'authentication.backends.api.SSOAuthentication')