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

Function activeOrg

e2e/cloud/oauth-callback-org-scope.test.ts:104–115  ·  view source on GitHub ↗
(baseUrl: string, cookie: string)

Source from the content-addressed store, hash-verified

102 });
103
104const activeOrg = (baseUrl: string, cookie: string) =>
105 Effect.promise(async () => {
106 const response = await fetch(new URL("/api/auth/me", baseUrl), {
107 headers: { cookie },
108 });
109 if (!response.ok) throw new Error(`/api/auth/me failed (${response.status})`);
110 const body = (await response.json()) as {
111 organization: { id: string; name: string; slug: string } | null;
112 };
113 if (!body.organization) throw new Error("identity has no active organization");
114 return body.organization;
115 });
116
117const createOrganization = (baseUrl: string, cookie: string, name: string) =>
118 Effect.promise(async () => {

Calls 2

jsonMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected