From 4337d94542143ebd2299c9294df8a1e86640b6c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E7=99=BD?= <wuzhihui1123@163.com>
Date: Mon, 24 Dec 2018 10:51:06 +0800
Subject: [PATCH]  next vaule: Priority use request.full_path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

login redirect next parameter Priority use request.full_path。 full_path contains url params
---
 flask_simpleldap/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/flask_simpleldap/__init__.py b/flask_simpleldap/__init__.py
index 82ae17f..b8af16d 100644
--- a/flask_simpleldap/__init__.py
+++ b/flask_simpleldap/__init__.py
@@ -302,7 +302,7 @@ class LDAP(object):
         def wrapped(*args, **kwargs):
             if g.user is None:
                 return redirect(url_for(current_app.config['LDAP_LOGIN_VIEW'],
-                                        next=request.path))
+                                        next=request.full_path or request.path))
             return func(*args, **kwargs)
 
         return wrapped
@@ -328,7 +328,7 @@ class LDAP(object):
                 if g.user is None:
                     return redirect(
                         url_for(current_app.config['LDAP_LOGIN_VIEW'],
-                                next=request.path))
+                                next=request.full_path or request.path))
                 match = [group for group in groups if group in g.ldap_groups]
                 if not match:
                     abort(401)
-- 
GitLab