vc
This commit is contained in:
parent
f58222fcff
commit
efa21d9328
2 changed files with 5 additions and 5 deletions
|
@ -85,6 +85,10 @@ mail = Mail(app)
|
||||||
|
|
||||||
@app.before_request
|
@app.before_request
|
||||||
def before_request():
|
def before_request():
|
||||||
|
if not session.get("session_id") and not request.path.startswith("/assets") and not request.path.startswith("/images") and not request.path.startswith("/hostedimages") and not request.path.startswith("/static") and not request.path.startswith("/song"):
|
||||||
|
session.permanent = True
|
||||||
|
session["session_id"] = secrets.token_hex(49)
|
||||||
|
|
||||||
if request.method.lower() != "get" and app.config["READ_ONLY"]:
|
if request.method.lower() != "get" and app.config["READ_ONLY"]:
|
||||||
return {"error":f"{app.config['SITE_NAME']} is currently in read-only mode."}, 500
|
return {"error":f"{app.config['SITE_NAME']} is currently in read-only mode."}, 500
|
||||||
|
|
||||||
|
|
|
@ -135,10 +135,6 @@ def notifications(v):
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def front_all(v):
|
def front_all(v):
|
||||||
|
|
||||||
if not session.get("session_id"):
|
|
||||||
session.permanent = True
|
|
||||||
session["session_id"] = secrets.token_hex(49)
|
|
||||||
|
|
||||||
if not v and request.path == "/" and not request.headers.get("Authorization"):
|
if not v and request.path == "/" and not request.headers.get("Authorization"):
|
||||||
return redirect(f"{SITE_FULL}/logged_out{request.full_path}")
|
return redirect(f"{SITE_FULL}/logged_out{request.full_path}")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue