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

Function resolveOrgSelector

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

Source from the content-addressed store, hash-verified

213// check; an unknown slug authorizes nothing. Ids pass straight through —
214// `authorizeOrganization` verifies live WorkOS membership either way.
215const resolveOrgSelector = (selector: string) =>
216 selector.startsWith("org_")
217 ? Effect.succeed(selector)
218 : Effect.gen(function* () {
219 const users = yield* UserStoreService;
220 const org = yield* users.use("getOrganizationBySlug", (s) =>
221 s.getOrganizationBySlug(selector),
222 );
223 return org?.id ?? null;
224 });
225
226export const McpOrganizationAuthLive = Layer.succeed(McpOrganizationAuth)({
227 authorize: (accountId, organizationSelector) =>

Callers 1

auth.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected