fix(routing): redirect anonymous users from protected routes + devtools rename

Bug 1: hard-loading / while unauthenticated stayed stuck on "Loading..."
forever. Cause: the _authed layout short-circuits to the spinner when
status is anything other than 'authenticated', which means child routes
never mount. The redirect-on-anonymous useEffect lived only in the
home page (_authed/index.tsx), so it never fired — the layout's spinner
was the last thing rendered.

Fix: add a useEffect to the _authed layout component itself that
navigates to /login on the 'anonymous' transition. The layout's gate
is now: beforeLoad redirects on cold-known-anonymous, useEffect
redirects on post-mount transitions to anonymous (e.g. boot probe
resolves to anonymous after the route already rendered).

Bug 2: console warning that @tanstack/router-devtools moved to
@tanstack/react-router-devtools. Same package, renamed.

Fix: pnpm remove @tanstack/router-devtools && pnpm add -D
@tanstack/react-router-devtools; updated the lazy import in __root.tsx
to point at the new package name.

Plus: TRM_Design_System-handoff/ added to .prettierignore — those files
are immutable source material from claude.ai/design and shouldn't be
reformatted.
This commit is contained in:
2026-05-02 20:00:20 +02:00
parent 8223a566e4
commit c833d6f3dd
5 changed files with 34 additions and 39 deletions
+1 -1
View File
@@ -34,8 +34,8 @@
"@eslint/js": "^10.0.1",
"@tailwindcss/vite": "^4.2.4",
"@tanstack/react-query-devtools": "^5.100.8",
"@tanstack/react-router-devtools": "^1.166.13",
"@tanstack/router-cli": "^1.166.40",
"@tanstack/router-devtools": "^1.166.13",
"@tanstack/router-plugin": "^1.167.32",
"@types/node": "^24.12.2",
"@types/react": "^19.2.14",