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

Function joinOrg

e2e/cloud/connection-owner-isolation.test.ts:98–108  ·  view source on GitHub ↗
(target: TargetShape, admin: Identity, member: Identity)

Source from the content-addressed store, hash-verified

96/** Invite `member` into `admin`'s org and accept — the real invite flow.
97 * Returns the member identity with its session re-bound to that org. */
98const joinOrg = (target: TargetShape, admin: Identity, member: Identity) =>
99 Effect.gen(function* () {
100 const inviteResponse = yield* postJson(target, "/api/account/members/invite", admin, {
101 email: member.credentials?.email,
102 });
103 const invitation = (yield* Effect.promise(() => inviteResponse.json())) as { id: string };
104 const acceptResponse = yield* postJson(target, "/api/auth/accept-invitation", member, {
105 invitationId: invitation.id,
106 });
107 return withRefreshedSession(member, acceptResponse);
108 });
109
110/** Create another org for this account; returns the identity bound to it. */
111const createAnotherOrg = (target: TargetShape, identity: Identity, name: string) =>

Calls 3

postJsonFunction · 0.70
withRefreshedSessionFunction · 0.70
jsonMethod · 0.65

Tested by

no test coverage detected