debug: Add logging to execute-stream auth
This commit is contained in:
parent
146cd29234
commit
f5d9fd5751
|
|
@ -1466,7 +1466,9 @@ async def execute_unified_prompt_stream(
|
||||||
Use this endpoint for long-running workflows (>30s) to avoid gateway timeouts.
|
Use this endpoint for long-running workflows (>30s) to avoid gateway timeouts.
|
||||||
"""
|
"""
|
||||||
# Manual auth: verify token and get profile_id
|
# Manual auth: verify token and get profile_id
|
||||||
|
logger.info(f"execute-stream: Received token: {token[:20] if token else 'None'}...")
|
||||||
if not token:
|
if not token:
|
||||||
|
logger.error("execute-stream: Missing auth token")
|
||||||
raise HTTPException(401, "Missing auth token")
|
raise HTTPException(401, "Missing auth token")
|
||||||
|
|
||||||
with get_db() as conn:
|
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,))
|
cur.execute("SELECT profile_id FROM sessions WHERE token = %s", (token,))
|
||||||
row = cur.fetchone()
|
row = cur.fetchone()
|
||||||
if not row:
|
if not row:
|
||||||
|
logger.error(f"execute-stream: Invalid token: {token[:20]}...")
|
||||||
raise HTTPException(401, "Invalid or expired token")
|
raise HTTPException(401, "Invalid or expired token")
|
||||||
profile_id = row['profile_id']
|
profile_id = row['profile_id']
|
||||||
|
logger.info(f"execute-stream: Auth successful for profile {profile_id}")
|
||||||
|
|
||||||
# Use default modules/timeframes if not provided
|
# Use default modules/timeframes if not provided
|
||||||
if not modules:
|
if not modules:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user