forked from rDrama/rDrama
dsf
parent
970d53b978
commit
0374e663af
|
@ -38,7 +38,6 @@ app.config['MAX_CONTENT_LENGTH'] = 8 * 1024 * 1024
|
||||||
app.config["SESSION_COOKIE_SECURE"] = True
|
app.config["SESSION_COOKIE_SECURE"] = True
|
||||||
app.config["SESSION_COOKIE_SAMESITE"] = "Lax"
|
app.config["SESSION_COOKIE_SAMESITE"] = "Lax"
|
||||||
app.config["PERMANENT_SESSION_LIFETIME"] = 60 * 60 * 24 * 365
|
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["SLOGAN"] = environ.get("SLOGAN", "").strip()
|
||||||
app.config["DEFAULT_COLOR"] = environ.get("DEFAULT_COLOR", "ff0000").strip()
|
app.config["DEFAULT_COLOR"] = environ.get("DEFAULT_COLOR", "ff0000").strip()
|
||||||
app.config["DEFAULT_THEME"] = environ.get("DEFAULT_THEME", "midnight").strip()
|
app.config["DEFAULT_THEME"] = environ.get("DEFAULT_THEME", "midnight").strip()
|
||||||
|
|
|
@ -125,6 +125,9 @@ def notifications(v):
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def front_all(v):
|
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 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
|
if v and v.is_banned and not v.unban_utc: return render_template('errors/500.html', error=True, v=v), 500
|
||||||
|
|
Loading…
Reference in New Issue