MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / resolveOrgSelector

Function resolveOrgSelector

apps/cloud/src/mcp/auth.ts:202–209  ·  view source on GitHub ↗
(selector: string)

Source from the content-addressed store, hash-verified

200// check; an unknown slug authorizes nothing. Ids pass straight through —
201// `authorizeOrganization` verifies live WorkOS membership either way.
202const resolveOrgSelector = (selector: string) =>
203 selector.startsWith("org_")
204 ? Effect.succeed(selector)
205 : Effect.gen(function* () {
206 const users = yield* UserStoreService;
207 const org = yield* users.use((s) => s.getOrganizationBySlug(selector));
208 return org?.id ?? null;
209 });
210
211export const McpOrganizationAuthLive = Layer.succeed(McpOrganizationAuth)({
212 authorize: (accountId, organizationSelector) =>

Callers 1

auth.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected