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

Function activeOrg

e2e/cloud/mcp-browser-approval-org-scope.test.ts:72–83  ·  view source on GitHub ↗
(baseUrl: string, cookie: string)

Source from the content-addressed store, hash-verified

70};
71
72const activeOrg = (baseUrl: string, cookie: string) =>
73 Effect.promise(async () => {
74 const response = await fetch(new URL("/api/auth/me", baseUrl), {
75 headers: { cookie },
76 });
77 if (!response.ok) throw new Error(`/api/auth/me failed (${response.status})`);
78 const body = (await response.json()) as {
79 organization: { id: string; name: string; slug: string } | null;
80 };
81 if (!body.organization) throw new Error("identity has no active organization");
82 return body.organization;
83 });
84
85const createOrganization = (baseUrl: string, cookie: string, name: string) =>
86 Effect.promise(async () => {

Calls 2

jsonMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected