feat(ui): Dashboard als Startseite für Verantwortliche + einstellbar
CI / backend-tests (push) Successful in 2m0s
CI / frontend-build (push) Successful in 19s

Root-Route "/" und Catch-all landeten bisher immer auf /objekte,
Login-Weiterleitung (Verantwortliche -> Dashboard) war der einzige
Pfad dorthin. Jetzt zentrale startseitenPfad()-Logik überall genutzt,
zusätzlich per Dropdown in der Sidebar einstellbar (automatisch/
Dashboard/Objekte), Präferenz in localStorage.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CVgbozhYmuEhiEJHffRXCV
This commit is contained in:
2026-09-06 13:37:02 +02:00
co-authored by Claude Sonnet 5
parent ed9ba29581
commit 21ea63a69a
5 changed files with 72 additions and 2 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ import { useNavigate } from "react-router-dom";
import { apiRequest } from "../api/client";
import { useAuth } from "../auth/AuthContext";
import type { Me } from "../api/types";
import { startseitenPfad } from "../settings/startseite";
const VERANTWORTLICH_ROLLEN = ["administration", "materialverantwortlicher", "leitungsverantwortlicher"];
@@ -26,7 +27,7 @@ export function LoginPage() {
// selbst /auth/me abfragen statt auf den Context zu warten.
const me = await apiRequest<Me>("/auth/me");
const istVerantwortlich = me.rollen.some((r) => VERANTWORTLICH_ROLLEN.includes(r));
navigate(istVerantwortlich ? "/dashboard" : "/objekte");
navigate(startseitenPfad(istVerantwortlich));
} catch {
setFehler("Login oder Passwort falsch");
} finally {