Give /api/org/current the domain the client requires

Fixkamo-internal
Ya
24 Agosti 2026, 22:15 UTC
Mwandishi
kamo
Ahadi ya
521d917

internal.kamocrm.com failed to render with "Invalid organization data: missing 'id' or 'domain'". Organization.fromJSON refuses a record without a domain, and the Organization entity does not carry one -- it has a `domains` collection. The by-host route injects the host it was asked about (route.ts:577); /api/org/current had no host to inject and returned the upstream JSON verbatim, so `domain` was undefined and the shell threw before it rendered. The domain is now derived: the org's own active top-level row when it has one, otherwise {alias}.kamocrm.com -- the same fallback SecurityService uses to name the org's theme folder, so branding resolves to the same place from both sides. Alias rows are skipped; they hold a bare label, not a hostname. When nothing can be derived the route 404s rather than return a record the client will throw on, and the layout falls back to the host lookup as it already does for a signed-out visitor. 2873 tests pass.

Mabadiliko yote

Je, unaona nini kuhusu usafiri?

Kila moja ya hizi updates ardhi katika nafasi yako ya kazi moja kwa moja. Kuanza bure na kuangalia kukua wiki baada ya wiki.

Kuwa Huru MileleMtazamo wa bei