From ecc7f1e6223f28167fbc327213307762988b60de Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 28 Jan 2022 22:02:21 +0200 Subject: [PATCH] sfd --- files/routes/login.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/files/routes/login.py b/files/routes/login.py index 2b32365cb..3a0050cc4 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -17,7 +17,9 @@ def login_get(v): redir = redir.replace("/logged_out", "").strip() if not redir.startswith(SITE_FULL) and not redir.startswith('/'): redir = None - if v and redir: return redirect(redir) + if v and redir: + if redir.startswith(SITE_FULL): return redirect(redir) + elif redir.startswith('/'): return redirect(f'{SITE_FULL}{redir}') return render_template("login.html", failed=False, redirect=redir) @@ -145,8 +147,9 @@ def login_post(): redir = redir.replace("/logged_out", "").strip() if not redir.startswith(SITE_FULL) and not redir.startswith('/'): redir = '/' - return redirect(redir) - + if redir.startswith(SITE_FULL): return redirect(redir) + if redir.startswith('/'): return redirect(f'{SITE_FULL}{redir}') + return redirect(f'{SITE_FULL}/') @app.get("/me") @app.get("/@me")