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

Function activeOrg

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

Source from the content-addressed store, hash-verified

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

Calls 2

jsonMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected