From 382614911f76d08c0a924e60bf3688dd1c601ae8 Mon Sep 17 00:00:00 2001 From: Jack Temple Date: Tue, 30 Sep 2025 09:23:23 -0500 Subject: [PATCH] fix: make /get/ui_theme_settings public for all users to access custom branding --- .../proxy_setting_endpoints.py | 4 +- .../src/contexts/ThemeContext.tsx | 41 +++++++++---------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py index 8c11760904c..1bb937f0b47 100644 --- a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py +++ b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py @@ -539,13 +539,15 @@ async def update_sso_settings(sso_config: SSOConfig): @router.get( "/get/ui_theme_settings", tags=["UI Theme Settings"], - dependencies=[Depends(user_api_key_auth)], response_model=UIThemeSettingsResponse, ) async def get_ui_theme_settings(): """ Get UI theme configuration from the litellm_settings. Returns current logo settings for UI customization. + + Note: This endpoint is public (no authentication required) so all users can see custom branding. + Only the /update/ui_theme_settings endpoint requires authentication for admins to change settings. """ from litellm.proxy.proxy_server import proxy_config diff --git a/ui/litellm-dashboard/src/contexts/ThemeContext.tsx b/ui/litellm-dashboard/src/contexts/ThemeContext.tsx index 619d6a1004a..7d53946d6d9 100644 --- a/ui/litellm-dashboard/src/contexts/ThemeContext.tsx +++ b/ui/litellm-dashboard/src/contexts/ThemeContext.tsx @@ -25,34 +25,33 @@ export const ThemeProvider: React.FC = ({ children, accessTo const [logoUrl, setLogoUrl] = useState(null); // Load logo URL from backend on mount + // Note: /get/ui_theme_settings is now a public endpoint (no auth required) + // so all users can see custom branding set by admins useEffect(() => { const loadLogoSettings = async () => { - if (accessToken) { - try { - const proxyBaseUrl = getProxyBaseUrl(); - const url = proxyBaseUrl ? `${proxyBaseUrl}/get/ui_theme_settings` : '/get/ui_theme_settings'; - const response = await fetch(url, { - method: 'GET', - headers: { - 'Authorization': `Bearer ${accessToken}`, - 'Content-Type': 'application/json', - }, - }); - - if (response.ok) { - const data = await response.json(); - if (data.values?.logo_url) { - setLogoUrl(data.values.logo_url); - } + try { + const proxyBaseUrl = getProxyBaseUrl(); + const url = proxyBaseUrl ? `${proxyBaseUrl}/get/ui_theme_settings` : '/get/ui_theme_settings'; + const response = await fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + + if (response.ok) { + const data = await response.json(); + if (data.values?.logo_url) { + setLogoUrl(data.values.logo_url); } - } catch (error) { - console.warn('Failed to load logo settings from backend:', error); } + } catch (error) { + console.warn('Failed to load logo settings from backend:', error); } }; - + loadLogoSettings(); - }, [accessToken]); + }, []); return (