aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--apioforum/__init__.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/apioforum/__init__.py b/apioforum/__init__.py
index 276568f..06595c9 100644
--- a/apioforum/__init__.py
+++ b/apioforum/__init__.py
@@ -49,9 +49,11 @@ def create_app():
@app.context_processor
def path_for_next():
- p = request.path
- if len(request.query_string) > 0 and not p.startswith("/auth"):
- p += "?" + request.query_string.decode("utf-8")
+ p = request.args.get('next', None)
+ if p is None:
+ p = request.path
+ if len(request.query_string) > 0:
+ p += "?" + request.query_string.decode("utf-8")
return dict(path_for_next=p)
app.jinja_env.globals.update(forum_path=forum.forum_path)