From 2e70c23307d85c7430bdf0523204863865797d79 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Thu, 19 Mar 2026 14:05:56 -0700 Subject: [PATCH] Gate legacy redirect on authLoading to ensure proxyBaseUrl is resolved The redirect useEffect fires before getUiConfig() completes, so proxyBaseUrl is always "" on first render. Gate on !authLoading so the redirect only fires after config is fetched, matching the pattern used by the login redirect. Co-Authored-By: Claude Opus 4.6 --- ui/litellm-dashboard/src/app/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index 3aac9621356..03431428add 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -256,11 +256,11 @@ function CreateKeyPageContent() { // Redirect legacy query-param pages to their new path-based routes const isLegacyRedirect = page in LEGACY_REDIRECTS; useEffect(() => { - if (isLegacyRedirect) { + if (!authLoading && isLegacyRedirect) { const base = (proxyBaseUrl || "") + "/ui"; router.replace(`${base}/${LEGACY_REDIRECTS[page]}`); } - }, [isLegacyRedirect, page, router]); + }, [authLoading, isLegacyRedirect, page, router]); // Check for a stored return URL after successful authentication // This handles the case where user comes back from SSO and we need to redirect to the original URL