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

Function resolveOrganization

apps/cloud/src/auth/organization.ts:38–47  ·  view source on GitHub ↗
(organizationId: string)

Source from the content-addressed store, hash-verified

36// read-path healing.
37
38export const resolveOrganization = (organizationId: string) =>
39 Effect.gen(function* () {
40 const users = yield* UserStoreService;
41 const existing = yield* users.use((s) => s.getOrganization(organizationId));
42 if (existing) return existing;
43
44 const workos = yield* WorkOSClient;
45 const fresh = yield* workos.getOrganization(organizationId);
46 return yield* users.use((s) => s.upsertOrganization({ id: fresh.id, name: fresh.name }));
47 });
48
49// ---------------------------------------------------------------------------
50// Authorization — live membership check against WorkOS.

Callers 4

handlers.tsFile · 0.90
handlers.tsFile · 0.90
resolveSessionMetaMethod · 0.90
authorizeOrganizationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected