From 1692789a01c4ff5394112b29a383a51fb9f79711 Mon Sep 17 00:00:00 2001 From: Adam Ladachowski Date: Sun, 15 Feb 2026 23:56:34 +0100 Subject: [PATCH] Add debug logging --- tensors/server/comfyui_routes.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tensors/server/comfyui_routes.py b/tensors/server/comfyui_routes.py index 769c336..6c29b2e 100644 --- a/tensors/server/comfyui_routes.py +++ b/tensors/server/comfyui_routes.py @@ -244,19 +244,26 @@ def _check_auth(comfy_session: str | None, path: str = "", method: str = "GET") because modulepreload/crossorigin requests don't send cookies. OPTIONS requests (CORS preflight) are also allowed without auth. """ + import logging + logger = logging.getLogger(__name__) + logger.info(f"_check_auth called: path={path!r}, method={method!r}, has_session={comfy_session is not None}") + if not COMFYUI_USER: - # Auth not configured, allow access + logger.info("Auth not configured, allowing") return # Allow CORS preflight requests (they don't send cookies) if method == "OPTIONS": + logger.info("OPTIONS request, allowing") return # Allow static assets without auth (modulepreload doesn't send cookies) if path.startswith("assets/"): + logger.info(f"Assets path, allowing: {path}") return if not _verify_session_token(comfy_session): + logger.info("Invalid session, redirecting to login") raise HTTPException( status_code=status.HTTP_307_TEMPORARY_REDIRECT, headers={"Location": "/comfy/login"},