master
Aevann1 2022-08-04 22:33:22 +02:00
parent 9d780a6aa8
commit 1568ec0162
6 changed files with 9 additions and 9 deletions

View File

@ -34,7 +34,7 @@ WORDLE_COLOR_MAPPINGS = {-1: "🟥", 0: "🟨", 1: "🟩"}
@app.get("/logged_out/post/<pid>/<anything>/<cid>") @app.get("/logged_out/post/<pid>/<anything>/<cid>")
@app.get("/logged_out/h/<sub>/comment/<cid>") @app.get("/logged_out/h/<sub>/comment/<cid>")
@app.get("/logged_out/h/<sub>/post/<pid>/<anything>/<cid>") @app.get("/logged_out/h/<sub>/post/<pid>/<anything>/<cid>")
@auth_desired @auth_required
def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None): def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}#context") if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}#context")

View File

@ -19,7 +19,7 @@ def error_401(e):
path = request.path path = request.path
qs = urlencode(dict(request.values)) qs = urlencode(dict(request.values))
argval = quote(f"{path}?{qs}", safe='') argval = quote(f"{path}?{qs}", safe='')
return redirect(f"/login?redirect={argval}") return redirect(f"/signup?redirect={argval}")
@app.errorhandler(406) @app.errorhandler(406)
def error_406(e): def error_406(e):

View File

@ -16,7 +16,7 @@ from files.helpers.awards import award_timers
@app.get("/logged_out/h/<sub>") @app.get("/logged_out/h/<sub>")
@app.get("/logged_out/s/<sub>") @app.get("/logged_out/s/<sub>")
@limiter.limit("3/second;30/minute;5000/hour;10000/day") @limiter.limit("3/second;30/minute;5000/hour;10000/day")
@auth_desired @auth_required
def front_all(v, sub=None, subdomain=None): def front_all(v, sub=None, subdomain=None):
if not v and not request.path.startswith('/logged_out'): if not v and not request.path.startswith('/logged_out'):

View File

@ -103,7 +103,7 @@ def submit_get(v, sub=None):
@app.get("/logged_out/post/<pid>/<anything>") @app.get("/logged_out/post/<pid>/<anything>")
@app.get("/logged_out/h/<sub>/post/<pid>") @app.get("/logged_out/h/<sub>/post/<pid>")
@app.get("/logged_out/h/<sub>/post/<pid>/<anything>") @app.get("/logged_out/h/<sub>/post/<pid>/<anything>")
@auth_desired @auth_required
def post_id(pid, anything=None, v=None, sub=None): def post_id(pid, anything=None, v=None, sub=None):
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}")
@ -233,7 +233,7 @@ def post_id(pid, anything=None, v=None, sub=None):
@app.get("/viewmore/<pid>/<sort>/<offset>") @app.get("/viewmore/<pid>/<sort>/<offset>")
@limiter.limit("1/second;30/minute;200/hour;1000/day") @limiter.limit("1/second;30/minute;200/hour;1000/day")
@auth_desired @auth_required
def viewmore(v, pid, sort, offset): def viewmore(v, pid, sort, offset):
try: pid = int(pid) try: pid = int(pid)
except: abort(400) except: abort(400)
@ -324,7 +324,7 @@ def viewmore(v, pid, sort, offset):
@app.get("/morecomments/<cid>") @app.get("/morecomments/<cid>")
@limiter.limit("1/second;30/minute;200/hour;1000/day") @limiter.limit("1/second;30/minute;200/hour;1000/day")
@auth_desired @auth_required
def morecomments(v, cid): def morecomments(v, cid):
try: cid = int(cid) try: cid = int(cid)
except: abort(400) except: abort(400)

View File

@ -437,7 +437,7 @@ def sub_sidebar(v, sub):
return redirect(f'/h/{sub.name}/settings') return redirect(f'/h/{sub.name}/settings')
@app.get("/holes") @app.get("/holes")
@auth_desired @auth_required
def subs(v): def subs(v):
subs = g.db.query(Sub, func.count(Submission.sub)).outerjoin(Submission, Sub.name == Submission.sub).group_by(Sub.name).order_by(func.count(Submission.sub).desc()).all() subs = g.db.query(Sub, func.count(Submission.sub)).outerjoin(Submission, Sub.name == Submission.sub).group_by(Sub.name).order_by(func.count(Submission.sub).desc()).all()
return render_template('sub/subs.html', v=v, subs=subs) return render_template('sub/subs.html', v=v, subs=subs)

View File

@ -904,7 +904,7 @@ def visitors(v):
@app.get("/@<username>") @app.get("/@<username>")
@app.get("/@<username>.json") @app.get("/@<username>.json")
@app.get("/logged_out/@<username>") @app.get("/logged_out/@<username>")
@auth_desired @auth_required
def u_username(username, v=None): def u_username(username, v=None):
if not v and not request.path.startswith('/logged_out'): if not v and not request.path.startswith('/logged_out'):
@ -1016,7 +1016,7 @@ def u_username(username, v=None):
@app.get("/@<username>/comments") @app.get("/@<username>/comments")
@app.get("/@<username>/comments.json") @app.get("/@<username>/comments.json")
@app.get("/logged_out/@<username>/comments") @app.get("/logged_out/@<username>/comments")
@auth_desired @auth_required
def u_username_comments(username, v=None): def u_username_comments(username, v=None):
if not v and not request.path.startswith('/logged_out'): if not v and not request.path.startswith('/logged_out'):