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

Function activeOrganizationFor

apps/cloud/src/auth/handlers.ts:251–257  ·  view source on GitHub ↗
(slug: string)

Source from the content-addressed store, hash-verified

249 memberships.data.filter((m) => m.status === "active").map((m) => m.organizationId),
250 );
251 const activeOrganizationFor = (slug: string) =>
252 users
253 .use("getOrganizationBySlug", (s) => s.getOrganizationBySlug(slug))
254 .pipe(
255 Effect.map((org) => (org && activeOrganizationIds.has(org.id) ? org.id : null)),
256 Effect.orElseSucceed(() => null),
257 );
258
259 // Prefer the org in the URL that sent the user to login. If the URL
260 // is bare, or not an org route, prefer the org this browser last

Callers 1

handlers.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected