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: