From a6c27aac51621788a3ad1d22b152c3cbe8a76457 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sat, 15 Aug 2026 17:46:27 +0200 Subject: [PATCH] fix(admin): stop asking for OIDC config where the route is closed On a centrally administered install /api/admin/oidc answers 403, and the admin page asked anyway. The promise was caught, so nothing broke, but the request still went out and still printed a red 403 in the console of every admin who opened the page. Swallowing a rejection hides a failure from the code, not from the person reading the console. --- client/src/pages/admin/useAdmin.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/pages/admin/useAdmin.ts b/client/src/pages/admin/useAdmin.ts index ab7fcf40e..2f7cda5af 100644 --- a/client/src/pages/admin/useAdmin.ts +++ b/client/src/pages/admin/useAdmin.ts @@ -121,7 +121,11 @@ export function useAdmin() { loadData() loadAppConfig() loadApiKeys() - adminApi.getOidc().then(setOidcConfig).catch(() => {}) + // Skipped rather than caught when the route is closed to us: the request + // still reaches the network, still answers 403, and still prints a red line + // in the console of every admin who opens this page. Swallowing the promise + // hides it from the code, not from the reader. + if (!managed) adminApi.getOidc().then(setOidcConfig).catch(() => {}) // The operator decides when this instance upgrades, so there is nothing to // check and nothing the admin could act on. if (managed) return