diff --git a/files/routes/front.py b/files/routes/front.py index 82967c68d..d3d03586a 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -169,6 +169,9 @@ def notifications(v): @auth_desired def front_all(v, sub=None, subdomain=None): + if g.webview and not session.get("session_id"): + session["session_id"] = secrets.token_hex(49) + if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") if v and request.path.startswith('/logged_out'): v = None @@ -176,9 +179,6 @@ def front_all(v, sub=None, subdomain=None): if (request.path.startswith('/h/') or request.path.startswith('/s/')) and not sub: abort(404) - if g.webview and not session.get("session_id"): - session["session_id"] = secrets.token_hex(49) - try: page = max(int(request.values.get("page", 1)), 1) except: abort(400)