RESTORE CACHE

This commit is contained in:
Aevann1 2022-04-19 22:21:47 +02:00
parent a3dc329a79
commit fe25f41fad
8 changed files with 78 additions and 38 deletions

View file

@ -157,8 +157,11 @@ def notifications(v):
@app.get("/")
@app.get("/logged_out")
@app.get("/h/<sub>")
@app.get("/logged_out/h/<sub>")
@app.get("/s/<sub>")
@app.get("/logged_out/s/<sub>")
@limiter.limit("3/second;30/minute;1000/hour;5000/day")
@auth_desired
def front_all(v, sub=None, subdomain=None):
@ -169,6 +172,11 @@ 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 request.path == "/" and not request.headers.get("Authorization"):
return redirect(f"/logged_out{request.full_path}")
if v and request.path.startswith('/logged_out'): v = None
try: page = max(int(request.values.get("page", 1)), 1)
except: abort(400)