forked from MarseyWorld/MarseyWorld
fixing infinite redirections
parent
de011ef7b1
commit
ddeba62aeb
|
@ -37,8 +37,8 @@ WORDLE_COLOR_MAPPINGS = {-1: "🟥", 0: "🟨", 1: "🟩"}
|
||||||
@auth_desired
|
@auth_desired
|
||||||
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.rstrip('?')}#context")
|
||||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','') + '#context')
|
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','').rstrip('?') + '#context')
|
||||||
|
|
||||||
try: cid = int(cid)
|
try: cid = int(cid)
|
||||||
except: abort(404)
|
except: abort(404)
|
||||||
|
|
|
@ -20,17 +20,12 @@ from files.helpers.awards import award_timers
|
||||||
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'):
|
||||||
r = request.full_path
|
return redirect(f"/logged_out{request.full_path.rstrip('?')}")
|
||||||
if r == '/?': r = '/'
|
|
||||||
return redirect(f"/logged_out{r}")
|
|
||||||
|
|
||||||
if v and v.is_banned and not v.unban_utc: return redirect('https://deuxrama.net')
|
if v and v.is_banned and not v.unban_utc: return redirect('https://deuxrama.net')
|
||||||
|
|
||||||
if v and request.path.startswith('/logged_out'):
|
if v and request.path.startswith('/logged_out'):
|
||||||
if v.id == AEVANN_ID:
|
return redirect(request.full_path.replace('/logged_out','').rstrip('?'))
|
||||||
r = request.full_path.replace('/logged_out','')
|
|
||||||
print(r)
|
|
||||||
return redirect(r)
|
|
||||||
|
|
||||||
if sub: sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
|
if sub: sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
|
||||||
|
|
||||||
|
|
|
@ -106,8 +106,8 @@ def submit_get(v, sub=None):
|
||||||
@auth_desired
|
@auth_desired
|
||||||
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.rstrip('?')}")
|
||||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out',''))
|
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','').rstrip('?'))
|
||||||
|
|
||||||
try: pid = int(pid)
|
try: pid = int(pid)
|
||||||
except Exception as e: pass
|
except Exception as e: pass
|
||||||
|
|
|
@ -59,8 +59,8 @@ def marsey_list():
|
||||||
@app.get('/logged_out/sidebar')
|
@app.get('/logged_out/sidebar')
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def sidebar(v):
|
def sidebar(v):
|
||||||
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.rstrip('?')}")
|
||||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out',''))
|
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','').rstrip('?'))
|
||||||
|
|
||||||
return render_template('sidebar.html', v=v)
|
return render_template('sidebar.html', v=v)
|
||||||
|
|
||||||
|
|
|
@ -906,8 +906,8 @@ def visitors(v):
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def u_username(username, v=None):
|
def u_username(username, v=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.rstrip('?')}")
|
||||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out',''))
|
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','').rstrip('?'))
|
||||||
|
|
||||||
u = get_user(username, v=v, rendered=True)
|
u = get_user(username, v=v, rendered=True)
|
||||||
|
|
||||||
|
@ -1002,8 +1002,8 @@ def u_username(username, v=None):
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def u_username_comments(username, v=None):
|
def u_username_comments(username, v=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.rstrip('?')}")
|
||||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out',''))
|
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','').rstrip('?'))
|
||||||
|
|
||||||
user = get_user(username, v=v, rendered=True)
|
user = get_user(username, v=v, rendered=True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue