From 0374e663afae415ac48d15806f811cddf68eb1bb Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 24 Dec 2021 03:30:48 +0200 Subject: [PATCH] dsf --- files/__main__.py | 1 - files/routes/front.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/files/__main__.py b/files/__main__.py index 9c3b7a3fc..0137a5ea8 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -38,7 +38,6 @@ app.config['MAX_CONTENT_LENGTH'] = 8 * 1024 * 1024 app.config["SESSION_COOKIE_SECURE"] = True app.config["SESSION_COOKIE_SAMESITE"] = "Lax" app.config["PERMANENT_SESSION_LIFETIME"] = 60 * 60 * 24 * 365 -app.config["SESSION_REFRESH_EACH_REQUEST"] = True app.config["SLOGAN"] = environ.get("SLOGAN", "").strip() app.config["DEFAULT_COLOR"] = environ.get("DEFAULT_COLOR", "ff0000").strip() app.config["DEFAULT_THEME"] = environ.get("DEFAULT_THEME", "midnight").strip() diff --git a/files/routes/front.py b/files/routes/front.py index 002487976..47841003f 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -125,6 +125,9 @@ def notifications(v): @auth_desired def front_all(v): + session.permanent = True + if not session.get("session_id"): session["session_id"] = secrets.token_hex(49) + if not v and request.path == "/" and not request.headers.get("Authorization"): return redirect(f"/logged_out{request.full_path}") if v and v.is_banned and not v.unban_utc: return render_template('errors/500.html', error=True, v=v), 500