debug: Add logging to execute-stream auth
All checks were successful
Deploy Development / deploy (push) Successful in 54s
Build Test / pytest-backend (push) Successful in 8s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s

This commit is contained in:
Lars 2026-04-13 15:29:14 +02:00
parent 146cd29234
commit f5d9fd5751

View File

@ -1466,7 +1466,9 @@ async def execute_unified_prompt_stream(
Use this endpoint for long-running workflows (>30s) to avoid gateway timeouts.
"""
# Manual auth: verify token and get profile_id
logger.info(f"execute-stream: Received token: {token[:20] if token else 'None'}...")
if not token:
logger.error("execute-stream: Missing auth token")
raise HTTPException(401, "Missing auth token")
with get_db() as conn:
@ -1474,8 +1476,10 @@ async def execute_unified_prompt_stream(
cur.execute("SELECT profile_id FROM sessions WHERE token = %s", (token,))
row = cur.fetchone()
if not row:
logger.error(f"execute-stream: Invalid token: {token[:20]}...")
raise HTTPException(401, "Invalid or expired token")
profile_id = row['profile_id']
logger.info(f"execute-stream: Auth successful for profile {profile_id}")
# Use default modules/timeframes if not provided
if not modules: