You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 31a8cd8
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .claude/skills/add-frontend-route/SKILL.md
+68-29Lines changed: 68 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,8 @@ contract per
32
32
33
33
- Operator portal pages — they live in `operator-portal`, a separate repo.
34
34
- Calling the API directly from a Client Component without the SDK — forbidden by
35
-
ESLint (`no-restricted-imports`).
35
+
ESLint (`no-restricted-globals` on `fetch`,
36
+
`frontend/packages/config/eslint/index.cjs`).
36
37
- Routes that bypass tenant resolution — every authenticated route requires a
37
38
resolved tenant.
38
39
@@ -52,7 +53,7 @@ contract per
52
53
53
54
| Group | Purpose | Auth | Default render |
54
55
|-------|---------|------|----------------|
55
-
|`(public)`| Tenant public site (marketing, catalog, blog). | Anonymous by default; auth optional. | SSR + ISR-like cache per `(tenantId, organizationId?, locale, slug)`. |
56
+
|`(public)`| Tenant public site (marketing, catalog, blog). | Anonymous by default; auth optional. | SSR + ISR-like cache per `(tenantId, organizationId?, locale, slug)` (under an open gate — see Step 8). |
56
57
|`(studio)`| Tenant admin Studio. | Tenant-admin or org-admin. Required at the edge. | SSR, no cache (always fresh). |
57
58
|`(portal)`| Learner / instructor portal. | Membership in the resolved tenant. | SSR shell + Client Component for interactivity. |
The Next.js middleware (`src/middleware.ts`) resolves the host via
99
-
`IHostToTenantResolver` and sets:
100
-
101
-
-`x-tenant-id` header
102
-
-`x-organization-id` header (when the host maps to a specific organization)
103
-
-`x-locale` header
104
-
105
-
The SDK reads these from the request context automatically; you don't pass them.
106
-
Don't read `host` directly inside a page; the resolution is the middleware's
107
-
contract.
107
+
The API resolves tenant and organization from the host
108
+
([ADR-0036 § Effective host and the trusted hop](../../../docs/decisions/0036-tenant-resolution-trusted-inputs.md#effective-host-and-the-trusted-hop)).
109
+
The frontend never calls `IHostToTenantResolver`, and ADR-0036 makes
110
+
`frontend/packages/sdk/src/server.ts` the only frontend place that sets the hop
111
+
headers. At HEAD that file is a typed stub, and `src/middleware.ts` is a scaffold
112
+
that copies the raw host into `x-tenant-id` and sets `x-locale`; it sets no
113
+
`x-organization-id`. Their replacement is recorded as G35 and G36 in
0 commit comments