(target: TargetShape, admin: Identity, member: Identity)
| 135 | |
| 136 | /** Invite `member` into `admin`'s org and accept — the real invite flow. */ |
| 137 | const joinOrg = (target: TargetShape, admin: Identity, member: Identity) => |
| 138 | Effect.gen(function* () { |
| 139 | const inviteResponse = yield* postJson(target, "/api/account/members/invite", admin, { |
| 140 | email: member.credentials?.email, |
| 141 | }); |
| 142 | const invitation = (yield* Effect.promise(() => inviteResponse.json())) as { id: string }; |
| 143 | const acceptResponse = yield* postJson(target, "/api/auth/accept-invitation", member, { |
| 144 | invitationId: invitation.id, |
| 145 | }); |
| 146 | return withRefreshedSession(member, acceptResponse); |
| 147 | }); |
| 148 | |
| 149 | const apiKeyTemplate = [ |
| 150 | { |
no test coverage detected