Commit 405e3c0
committed
Connect card: pin the MCP install URL to the URL's org, not the cookie's
A multi-org user loading /<orgB> while their session cookie still points at
orgA saw orgA's slug flash into the copyable `npx add-mcp .../<slug>/mcp` box
before /account/me resolved. On first paint `auth.organization` comes from the
SSR auth-hint, which is scoped to the COOKIE's org — but the page is scoped to
the URL's org.
Seed OrganizationProvider's slug (which feeds the connect card via
useOrganizationSlug) from the URL's `{-$orgSlug}` param, falling back to the
session slug on a bare URL (which OrgSlugGate canonicalizes onto it anyway). The
URL slug is the actual request scope and is correct on the very first paint, so
the wrong slug never appears. OrgSlugGate keeps using the session slug for
canonicalization; only the install-URL context changes. useOrganizationSlug is
consumed solely by the connect card, so there's no other blast radius.1 parent ce39ffc commit 405e3c0
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
278 | 287 | | |
279 | 288 | | |
280 | 289 | | |
| |||
284 | 293 | | |
285 | 294 | | |
286 | 295 | | |
287 | | - | |
| 296 | + | |
288 | 297 | | |
289 | 298 | | |
290 | 299 | | |
| |||
0 commit comments