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.
This commit is contained in:
Maurice
2026-08-15 17:46:27 +02:00
committed by Maurice
parent f2329c9a63
commit a6c27aac51
+5 -1
View File
@@ -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