From 3a3da94468f45237ac6d7a4784541b785d5bcfc7 Mon Sep 17 00:00:00 2001 From: BaiJiangJie <32935519+BaiJiangJie@users.noreply.github.com> Date: Thu, 25 Apr 2019 18:55:48 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=E9=A2=84=E7=95=99?= =?UTF-8?q?/auth/login/=E9=A1=B5=E9=9D=A2=E6=96=B9=E5=BC=8F(admin=3D1)?= =?UTF-8?q?=EF=BC=9B=E8=A7=A3=E5=86=B3luna=E9=A1=B5=E9=9D=A2=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E4=B8=8D=E8=B7=B3=E8=BD=ACopenid=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#2634)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/views/login.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/authentication/views/login.py b/apps/authentication/views/login.py index fc2270eba..53112fcac 100644 --- a/apps/authentication/views/login.py +++ b/apps/authentication/views/login.py @@ -59,6 +59,11 @@ class UserLoginView(FormView): return redirect(redirect_user_first_login_or_index( request, self.redirect_field_name) ) + # show jumpserver login page if request http://{JUMP-SERVER}/?admin=1 + if settings.AUTH_OPENID and not self.request.GET.get('admin', 0): + query_string = request.GET.urlencode() + login_url = "{}?{}".format(settings.LOGIN_URL, query_string) + return redirect(login_url) request.session.set_test_cookie() return super().get(request, *args, **kwargs)