Skip to content

Self-hosted homelab infrastructure visualizer — interactive network diagram with live status monitoring

fix(auth): migrate from deprecated authlib.jose to joserfc

slmingolbb23dcb9529d
diff --git a/backend/app/api/routes/auth.py b/backend/app/api/routes/auth.py
index 527088f..727d5d5 100644
--- a/backend/app/api/routes/auth.py
+++ b/backend/app/api/routes/auth.py
@@ -4,8 +4,9 @@ from collections.abc import Mapping
from typing import cast
from authlib.integrations.base_client.errors import OAuthError
-from authlib.jose.errors import JoseError
+from authlib.jose.errors import JoseError as _AuthlibJoseError # authlib 1.7.x still raises this; drop after 2.0
from fastapi import APIRouter, Depends, HTTPException, Request, Response, status
+from joserfc.errors import JoseError
from pydantic import BaseModel
from starlette.responses import RedirectResponse
@@ -87,7 +88,7 @@ async def oidc_callback(request: Request) -> Response:
client = get_oidc_client()
try:
token = await client.authorize_access_token(request)
- except (OAuthError, JoseError) as exc:
+ except (OAuthError, JoseError, _AuthlibJoseError) as exc:
logger.warning("OIDC callback rejected: %s", exc.error)
request.session.clear()
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="OIDC authentication failed") from None
diff --git a/backend/requirements.txt b/backend/requirements.txt
index 7837f7b..25187c5 100644
--- a/backend/requirements.txt
+++ b/backend/requirements.txt
@@ -9,6 +9,7 @@ pydantic-settings==2.5.2
PyJWT==2.13.0
bcrypt==4.2.1
authlib==1.7.2
+joserfc>=1.6.0
itsdangerous==2.2.0
python-multipart==0.0.31
apscheduler==3.10.4