From 17a402935ee886f7ae1fc588d1f5604d4a987c3e Mon Sep 17 00:00:00 2001 From: frannnnk Date: Sun, 5 Jul 2026 22:29:37 +0800 Subject: [PATCH] fix(dashboard): prevent auto-SSO redirect for basic auth provider --- hermes_cli/dashboard_auth/middleware.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hermes_cli/dashboard_auth/middleware.py b/hermes_cli/dashboard_auth/middleware.py index 2c5f5b4f7b95..7f9a3d031f94 100644 --- a/hermes_cli/dashboard_auth/middleware.py +++ b/hermes_cli/dashboard_auth/middleware.py @@ -185,6 +185,11 @@ def _auto_sso_response(request: Request) -> Response | None: from hermes_cli.dashboard_auth.prefix import prefix_from_request provider = providers[0] + # Basic auth (password) has no OAuth redirect flow; auto-redirecting to + # /auth/login would just NotImplementedError. Let /login render. + if provider.name == "basic": + return None + prefix = prefix_from_request(request) next_param = _safe_next_target(request) from urllib.parse import quote