From f5d9fd5751c2d8b4b6877c5e2beeb9cfacb7d356 Mon Sep 17 00:00:00 2001 From: Lars Date: Mon, 13 Apr 2026 15:29:14 +0200 Subject: [PATCH] debug: Add logging to execute-stream auth --- backend/routers/prompts.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/routers/prompts.py b/backend/routers/prompts.py index 4904f01..a00c801 100644 --- a/backend/routers/prompts.py +++ b/backend/routers/prompts.py @@ -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: