fix(unit-2-auth): Redirect to /setup on API failure; store owner display name
- Router catch block now falls back to { initialized: false } instead of
silently continuing, preventing unwanted redirect to /login when the
API call fails at startup
- Add Name field to CreateOwnerRequest and propagate to ApplicationUser.DisplayName
so the owner's display name is stored during initial setup
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -91,9 +91,11 @@ const rootRoute = createRootRouteWithContext<RouterContext>()({
|
||||
let status: SetupStatus;
|
||||
try {
|
||||
status = await fetchSetupStatus();
|
||||
} catch {
|
||||
// Network failure — let routes render; API calls will surface errors.
|
||||
return;
|
||||
} catch (err) {
|
||||
// On network failure, assume not initialized so the user can set up
|
||||
// the system once the backend is reachable. Logging helps debugging.
|
||||
console.warn('[InitGuard] Setup status check failed, assuming not initialized:', err);
|
||||
status = { initialized: false };
|
||||
}
|
||||
|
||||
const onSetup = location.pathname === '/setup';
|
||||
|
||||
Reference in New Issue
Block a user