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
Improvement: ORG_SLUG_REQUIRED / ORG_SLUG_INVALID never tell an authenticated API caller their own valid org slugs #3097
When an authenticated API caller belongs to multiple organizations, ORG_SLUG_REQUIRED tells them to provide X-Organization-Slug — but nothing tells them which slugs are valid. A caller who mistypes gets the deliberately ambiguous ORG_SLUG_INVALID and is left guessing.
Evidence — one authenticated API caller's 3-minute struggle on 2026-08-25 (GlitchTip, demo.tale.dev)
10:32:28 TALE-PROJECT-11T — ORG_SLUG_REQUIRED: User belongs to multiple organizations. Provide X-Organization-Slug header.
10:32:58 TALE-PROJECT-11U — ORG_SLUG_INVALID: Organization not found: vatplus
Then silence — gave up, or found the slug somewhere else. All via organizations/resolve_user_organization:resolveUserOrganization, the resolver shared by every API-key-authenticated HTTP surface (services/platform/convex/organizations/resolve_user_organization.ts).
Read
The resolver's anti-probing design (see the file's header note: an explicit slug always requires a current membership, so foreign slugs can't be probed) is right and must stay. But when the caller is already authenticated and the failure is "you belong to multiple orgs, pick one", listing the caller's own membership slugs discloses nothing — it's their data — and would have ended this in one round-trip.
Proposed fix
ORG_SLUG_REQUIRED throw (~line 137): include the caller's member org slugs in the error data/message, e.g. … Provide X-Organization-Slug header. Your organizations: acme, vatplus-gmbh.
ORG_SLUG_INVALID throw (~line 54): keep the deliberately ambiguous Organization not found: <slug> (anti-probe), but append the same own-memberships list for authenticated callers — it reveals nothing about the probed slug beyond what the message already does.
Check that the API docs / the settings surface where API keys are issued show the org slug to copy.
Acceptance
A multi-org API caller who omits or mistypes the header learns their valid slugs from the error response itself; nothing about non-member orgs is disclosed.
Filed by the GlitchTip triage sweep of demo.tale.dev (2026-08-28). Tracked on the tale board as TAL-20 — "API org resolution demands X-Organization-Slug but never says which slugs are valid" (status: backlog).
Activity