From c5c6a5f71bf33956b6e5be67c877b1f8cee70da9 Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Fri, 24 Apr 2026 11:26:50 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20HA=20Passwort-Auth=20loggt=20nicht=20meh?= =?UTF-8?q?r=20aus,=20Radio-Layout=20korrigiert=20-=20Backend=20gibt=20400?= =?UTF-8?q?=20statt=20401=20bei=20falschen=20HA-Credentials=20zur=C3=BCck,?= =?UTF-8?q?=20damit=20=20=20der=20globale=20api.js-Logout-Handler=20nicht?= =?UTF-8?q?=20ausgel=C3=B6st=20wird=20-=20Null-Guard=20im=20JS=20nach=20ap?= =?UTF-8?q?i.post=20verhindert=20den=20"calendars=20of=20null"-Crash=20-?= =?UTF-8?q?=20Radio-Buttons=20f=C3=BCr=20Anmeldemethode=20nicht=20mehr=20i?= =?UTF-8?q?n=20form-group,=20damit=20=20=20input[type=3Dradio]=20kein=20wi?= =?UTF-8?q?dth:100%=20bekommt=20und=20sauber=20nebeneinander=20liegt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/routers/homeassistant_router.py | 4 ++-- frontend/index.html | 14 +++++++------- frontend/js/calendar.js | 1 + 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/backend/routers/homeassistant_router.py b/backend/routers/homeassistant_router.py index 28a3fee..77f4e05 100644 --- a/backend/routers/homeassistant_router.py +++ b/backend/routers/homeassistant_router.py @@ -39,7 +39,7 @@ def _ha_login(url: str, username: str, password: str) -> tuple: except http_requests.exceptions.Timeout: raise HTTPException(503, "Home Assistant antwortet nicht (Timeout)") if resp.status_code in (400, 401): - raise HTTPException(401, "Ungültige Anmeldedaten") + raise HTTPException(400, "Ungültige Anmeldedaten") resp.raise_for_status() data = resp.json() return data["access_token"], data.get("refresh_token", ""), data.get("expires_in", 1800) @@ -99,7 +99,7 @@ def _ha_get_calendars(url: str, token: str) -> list: raise HTTPException(503, "Home Assistant antwortet nicht (Timeout)") except http_requests.exceptions.HTTPError as e: if e.response is not None and e.response.status_code == 401: - raise HTTPException(401, "Ungültiger Access Token") + raise HTTPException(400, "Ungültiger Access Token") raise HTTPException(502, f"Home Assistant Fehler: {e}") diff --git a/frontend/index.html b/frontend/index.html index b9685bf..14ec8ac 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -416,14 +416,14 @@ -
- -
-