From a6cdaec22171bda7c75ba1056638df67d4f85607 Mon Sep 17 00:00:00 2001 From: Tomas Kubla Date: Wed, 15 Nov 2023 18:51:26 +0100 Subject: [PATCH] Authenticate, go home from login page --- dojo/user/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dojo/user/views.py b/dojo/user/views.py index f021aa00460..9a7e2da040c 100644 --- a/dojo/user/views.py +++ b/dojo/user/views.py @@ -108,6 +108,8 @@ def api_v2_key(request): @dojo_ratelimit(key='post:username') @dojo_ratelimit(key='post:password') def login_view(request): + if request.user.is_authenticated: + return HttpResponseRedirect(reverse('home')) if not settings.SHOW_LOGIN_FORM and settings.SOCIAL_LOGIN_AUTO_REDIRECT and sum([ settings.GOOGLE_OAUTH_ENABLED, settings.OKTA_OAUTH_ENABLED,