Build [v1.4.1] - Security hardening, PWA and UI refinements

This commit is contained in:
Daniel Bedeleanu
2026-04-12 10:45:57 +03:00
parent f3d861b1a2
commit 50ae3671c9
16 changed files with 492 additions and 176 deletions

View File

@@ -66,8 +66,7 @@ async def get_current_user(credentials = Depends(security)):
token = credentials.credentials
import logging
log = logging.getLogger("ainventory")
log.debug(f"[AUTH] Validating token (first 20 chars): {token[:20] if token else 'None'}")
log.debug(f"[AUTH] Using SECRET_KEY (first 10 chars): {SECRET_KEY[:10] if SECRET_KEY else 'None'}")
log.debug(f"[AUTH] Validating token (first 10 chars): {token[:10] if token else 'None'}")
try:
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
user_id: int = int(payload.get("sub")) # sub is stored as string, convert back to int