fix: Normalize domain when logging in
All checks were successful
Build Docker / Build Docker (push) Successful in 28s

This commit is contained in:
Nathan Woodburn 2024-06-22 16:17:19 +10:00
parent c25bcbef84
commit 2f121e38f8
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -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/<username>")
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"})