From b5cd301678cf53ecd83d193b1017be4540c4cee3 Mon Sep 17 00:00:00 2001 From: "stirlingbot[bot]" <195170888+stirlingbot[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:14:41 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20format=20everything=20with=20pre?= =?UTF-8?q?-commit=20by=20stirlingbot=20(#4175)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Auto-generated by [create-pull-request][1] with **stirlingbot** [1]: https://github.com/peter-evans/create-pull-request Signed-off-by: stirlingbot[bot] Co-authored-by: stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com> --- frontend/src/core/contexts/AppConfigContext.tsx | 12 ++++++------ frontend/src/core/hooks/useEndpointConfig.ts | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/core/contexts/AppConfigContext.tsx b/frontend/src/core/contexts/AppConfigContext.tsx index d8a2a13c24..9695578455 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 eb1f6ef2ff..42c20600c0 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;