MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / joinCommunity

Function joinCommunity

apps/web/services/invites.ts:262–276  ·  view source on GitHub ↗
(
  email: string,
  accountId: string,
  authId: string
)

Source from the content-addressed store, hash-verified

260}
261
262export async function joinCommunity(
263 email: string,
264 accountId: string,
265 authId: string
266) {
267 const user = await findUser(accountId, authId);
268 if (!!user) {
269 await checkoutTenant(authId, accountId);
270 return { data: 'user already belongs to tenant' };
271 }
272 const displayName = normalize(email.split('@').shift() || email);
273 const record = await createUser({ accountId, authId, displayName });
274 await checkoutTenant(authId, accountId);
275 await createChannelMemberships(accountId, record.id);
276}
277
278async function createUser({
279 accountId,

Callers 1

handlerFunction · 0.90

Calls 5

normalizeFunction · 0.90
checkoutTenantFunction · 0.85
createChannelMembershipsFunction · 0.85
findUserFunction · 0.70
createUserFunction · 0.70

Tested by

no test coverage detected