feat: scope workspace routes by organization slug

This commit is contained in:
2026-07-02 20:11:57 -07:00
parent fae97a7046
commit 3ab0e3e034
48 changed files with 565 additions and 96 deletions

View File

@@ -216,6 +216,17 @@ surface.
implemented, show an honest not-connected state instead of fake provider accounts.
- The sidebar nav selected state belongs in a small client component using `usePathname()`;
keep the rest of `AppShell` server-rendered.
- Authenticated workspace links should preserve the active organization slug by using
`modules/shared/lib/workspace-routing.ts`. Sidebar links, breadcrumbs, permission
redirects, table search/pagination paths, login redirects, and organization switch
redirects should call `getWorkspaceHref(activeSlug, workspacePath)` instead of hard-coding
`/app/...` paths.
- The legacy unscoped `/app/...` paths remain valid fallback paths for accounts without an
active organization. When a session has an active organization, redirect into
`/app/{organizationSlug}/...` so operators can see which workspace they are using.
- Top-level workspace route names such as `dashboard`, `settings`, `elders`, and `beds` are
reserved path segments, not tenant identifiers. Keep the frontend reserved list in
`workspace-routing.ts` aligned with backend organization slug validation.
### Business Form Defaults Contract