diff --git a/frontend/src/core/contexts/AppConfigContext.tsx b/frontend/src/core/contexts/AppConfigContext.tsx index d8a2a13c2..969557845 100644 --- a/frontend/src/core/contexts/AppConfigContext.tsx +++ b/frontend/src/core/contexts/AppConfigContext.tsx @@ -71,12 +71,12 @@ export const AppConfigProvider: React.FC<{ children: React.ReactNode }> = ({ chi const isLoginPage = window.location.pathname.includes('/login'); const hasJwt = !!localStorage.getItem('stirling_jwt'); - if (isLoginPage && !hasJwt) { - console.debug('[AppConfigContext] On login page without JWT - using default config'); - setConfig({ enableLogin: true }); - setLoading(false); - return; - } + if (isLoginPage && !hasJwt) { + console.debug('[AppConfig] On login page without JWT - using default config'); + setConfig({ enableLogin: true }); + setLoading(false); + return; + } try { setLoading(true); diff --git a/frontend/src/core/hooks/useEndpointConfig.ts b/frontend/src/core/hooks/useEndpointConfig.ts index eb1f6ef2f..42c20600c 100644 --- a/frontend/src/core/hooks/useEndpointConfig.ts +++ b/frontend/src/core/hooks/useEndpointConfig.ts @@ -9,6 +9,7 @@ function getAuthHeaders(): HeadersInit { /** * Hook to check if a specific endpoint is enabled + * This wraps the context for single endpoint checks */ export function useEndpointEnabled(endpoint: string): { enabled: boolean | null;