Setup-pagina verschijnt niet meer als de setup-status niet te lezen is

De route-guard las elke fout (429, 500, 503, 404) als 'niet geinitialiseerd' en stuurde naar de
setup-pagina. Nu geen gok: bij een onleesbare status geen doorverwijzing. De statuslezing valt onder de
ruimere limiter in plaats van de strikte login-limiter (die 5 per minuut deelt met echte inlogpogingen).
De loginpagina meldt als het CMS uitgeschakeld of in onderhoud is.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 08:53:37 +01:00
co-authored by Claude Sonnet 5.5
parent 701091f179
commit ff94719455
9 changed files with 188 additions and 4 deletions
+7 -3
View File
@@ -110,12 +110,16 @@ const rootRoute = createRootRouteWithContext<RouterContext>()({
try {
status = await fetchSetupStatus();
} catch (err) {
// The status could not be read (backend unreachable, rate limited, a 5xx, a disabled CMS...). That
// says nothing about whether the system is set up, and guessing "not set up" would send people to
// the setup page of a system that already has its owner. So: no redirect either way. The normal
// pages (login, with its own notice when the CMS is off) deal with the situation.
if (err instanceof NetworkError) {
// Backend unreachable: skip setup redirect and show the login page instead.
// Backend unreachable: treat it as set up, so /setup leads to the login page (unchanged behaviour).
status = { initialized: true };
} else {
console.warn('[InitGuard] Setup status check failed, assuming not initialized:', err);
status = { initialized: false };
console.warn('[InitGuard] Setup status could not be read, not redirecting:', err);
return;
}
}