diff --git a/flask_simpleldap/__init__.py b/flask_simpleldap/__init__.py index abeb418..f288d9a 100644 --- a/flask_simpleldap/__init__.py +++ b/flask_simpleldap/__init__.py @@ -304,7 +304,7 @@ def login_required(func): 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 @@ -330,7 +330,7 @@ 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)) match = [group for group in groups if group in g.ldap_groups] if not match: abort(401)