Fix login by serving users file via API

This commit is contained in:
2025-08-10 03:55:00 -06:00
parent 99963f067c
commit d931035fd9
2 changed files with 16 additions and 2 deletions

View File

@@ -61,6 +61,20 @@ def serve_dist(path):
def health():
return jsonify({"status": "ok"})
# ---------------------------------------------
# User Authentication Endpoint
# ---------------------------------------------
@app.route("/api/users", methods=["GET"])
def get_users():
users_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "..", "..", "users.json")
)
try:
with open(users_path, "r", encoding="utf-8") as fh:
return jsonify(json.load(fh))
except Exception:
return jsonify({"users": []})
# ---------------------------------------------
# Borealis Python API Endpoints
# ---------------------------------------------