Skip to content

Commit

Permalink
Don't include /? in the next argument when user comes in to the index…
Browse files Browse the repository at this point in the history
… page
  • Loading branch information
robbason committed Jan 27, 2020
1 parent 9a81914 commit 3f5b13a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flask_simpleldap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,12 @@ def login_required(func):
@wraps(func)
def wrapped(*args, **kwargs):
if g.user is None:
next_path=request.full_path or request.path
if next_path == '/?':
return redirect(
url_for(current_app.config['LDAP_LOGIN_VIEW']))
return redirect(url_for(current_app.config['LDAP_LOGIN_VIEW'],
next=request.full_path or request.path))
next=next_path))
return func(*args, **kwargs)

return wrapped
Expand Down

0 comments on commit 3f5b13a

Please sign in to comment.