From 2f121e38f8d426f4d057aa776739362cccfc5111 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sat, 22 Jun 2024 16:17:19 +1000 Subject: [PATCH] fix: Normalize domain when logging in --- website/routes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/website/routes.py b/website/routes.py index a440cc8..857f80c 100644 --- a/website/routes.py +++ b/website/routes.py @@ -263,7 +263,7 @@ def hnsid_domain(domain): @bp.route("/txt", methods=["POST"]) def txtLogin(): # Get domain from form - domain = request.form.get("domain") + domain = request.form.get("domain").lower().strip().replace("/", "") # Get uuid uuid = session["uuid"] @@ -330,7 +330,7 @@ def txtLoginDomain(domain): # Get uuid uuid = session["uuid"] - idns_records = get_idns_records(domain) + idns_records = get_idns_records(domain.lower().strip().replace("/", "")) for record in idns_records: @@ -593,6 +593,7 @@ def api_me(): @bp.route("/u/") def profile(username): + username = username.lower().strip().replace("/", "") user = User.query.filter_by(username=username).first() if not user: return jsonify({"error": "User not found"})