From 39545e556f516d1ffbf5a7a9e1828a5f8b3bd7a4 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Mon, 17 Oct 2022 19:11:50 -0500 Subject: [PATCH] WPD: disable /logged_out on .co, fixing infinite loop WPD: fix bad asset link WPD: redirect on migration login and failed migration login --- files/helpers/wrappers.py | 5 +++++ files/routes/front.py | 4 +++- files/templates/wpdco.html | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index 0fe7ad8570..0d5cbccb86 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -106,6 +106,11 @@ def auth_desired_with_logingate(f): v = get_logged_in_user() if app.config['SETTINGS']['login_required'] and not v: abort(401) + #### WPD TEMP #### disable this /logged_out thing on .co + if request.host == 'watchpeopledie.co': + return make_response(f(*args, v=v, **kwargs)) + #### END WPD TEMP #### + if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") diff --git a/files/routes/front.py b/files/routes/front.py index c6632e25e7..e0f776fddf 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -24,7 +24,7 @@ def front_all(v, sub=None, subdomain=None): if request.host == 'watchpeopledie.co': if v and not v.admin_level: # security: don't auto login admins hash = generate_hash(f'{v.id}+{now.year}+{now.month}+{now.day}+{now.hour}+WPDusermigration') - return redirect(f'https://watchpeopledie.tv/?user={v.id}&code={hash}', 301) + return redirect(f'https://watchpeopledie.tv/logged_out?user={v.id}&code={hash}', 301) else: return render_template('wpdco.html') elif request.host == 'watchpeopledie.tv' and not v: # security: don't try to login people into accounts more than once @@ -39,6 +39,8 @@ def front_all(v, sub=None, subdomain=None): else: if validate_hash(req_code, f'{v.id}+{now.year}+{now.month}+{now.day}+{now.hour}+WPDusermigration'): on_login(user) + return redirect('/') + return redirect('/logged_out') #### WPD TEMP #### end special front logic if sub: sub = sub.strip().lower() diff --git a/files/templates/wpdco.html b/files/templates/wpdco.html index 2bbc122a27..b0d47b52ec 100644 --- a/files/templates/wpdco.html +++ b/files/templates/wpdco.html @@ -55,7 +55,7 @@
- +