From 08b68328091504fa232a2c64b2f9e1d2c531ca7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20V=C3=A9zina?= Date: Wed, 19 Aug 2015 14:41:54 -0400 Subject: [PATCH] No credentials request if logged in and URL contains user/login?_next= --- gluon/tools.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gluon/tools.py b/gluon/tools.py index 76a3fa81..8e63caee 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -2497,6 +2497,10 @@ class Auth(object): """ Returns a login form """ + # Avoid asking for credentials when page reload and page URL contains + # "user/login?_next=NEXT_COMPONENT" if user is already authenticated + if self.get_vars_next() is not None and self.get_vars_next() != '' and self.is_logged_in(): + redirect(self.get_vars_next()) table_user = self.table_user() settings = self.settings