Skip to content

Commit 7dcddf2

Browse files
Merge pull request #72 from robbason/master
Don't include /? in the next argument when user comes in to the index
2 parents 1e5b4b0 + 3f5b13a commit 7dcddf2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

flask_simpleldap/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,12 @@ def login_required(func):
296296
@wraps(func)
297297
def wrapped(*args, **kwargs):
298298
if g.user is None:
299+
next_path=request.full_path or request.path
300+
if next_path == '/?':
301+
return redirect(
302+
url_for(current_app.config['LDAP_LOGIN_VIEW']))
299303
return redirect(url_for(current_app.config['LDAP_LOGIN_VIEW'],
300-
next=request.full_path or request.path))
304+
next=next_path))
301305
return func(*args, **kwargs)
302306

303307
return wrapped

0 commit comments

Comments
 (0)