changeset 7504:8f8ee972820f

auth: don't ignore login POSTs if already logged in This is probably only rarely a big deal, but ignoring an explicit command seems wrong. This makes it possible to easily re-authenticate - we will need this ...
author Mads Kiilerich <mads@kiilerich.com>
date Sat, 29 Dec 2018 16:16:36 +0100
parents 69f70de15f26
children 5d7a1997a8d9
files kallithea/controllers/login.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/login.py	Sun Dec 30 20:28:06 2018 +0100
+++ b/kallithea/controllers/login.py	Sat Dec 29 16:16:36 2018 +0100
@@ -76,10 +76,6 @@
         else:
             c.came_from = url('home')
 
-        # redirect if already logged in
-        if request.authuser.is_authenticated:
-            raise HTTPFound(location=c.came_from)
-
         if request.POST:
             # import Login Form validator class
             login_form = LoginForm()()
@@ -109,6 +105,10 @@
                 log_in_user(user, c.form_result['remember'],
                     is_external_auth=False)
                 raise HTTPFound(location=c.came_from)
+        else:
+            # redirect if already logged in
+            if request.authuser.is_authenticated:
+                raise HTTPFound(location=c.came_from)
 
         return render('/login.html')