Normalize setup admin username (#448)

This commit is contained in:
red person
2026-06-01 16:38:56 +03:00
committed by GitHub
parent 448401a0fc
commit 39cec53284
2 changed files with 26 additions and 1 deletions

View File

@@ -54,7 +54,7 @@ def create_default_admin():
import bcrypt
import json
username = os.getenv("ODYSSEUS_ADMIN_USER", "admin").strip() or "admin"
username = os.getenv("ODYSSEUS_ADMIN_USER", "admin").strip().lower() or "admin"
password = os.getenv("ODYSSEUS_ADMIN_PASSWORD") or __import__("secrets").token_urlsafe(18)
hashed = bcrypt.hashpw(password.encode(), bcrypt.gensalt()).decode()
auth_data = {