MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / joinCommunityAfterSignIn

Function joinCommunityAfterSignIn

apps/web/services/invites.ts:318–355  ·  view source on GitHub ↗
({
  request,
  response,
  communityId,
  authId,
  displayName,
  profileImageUrl,
}: {
  request: any;
  response: any;
  communityId: string;
  authId: string;
  displayName: string;
  profileImageUrl?: string;
})

Source from the content-addressed store, hash-verified

316}
317
318export async function joinCommunityAfterSignIn({
319 request,
320 response,
321 communityId,
322 authId,
323 displayName,
324 profileImageUrl,
325}: {
326 request: any;
327 response: any;
328 communityId: string;
329 authId: string;
330 displayName: string;
331 profileImageUrl?: string;
332}) {
333 const permissions = await PermissionsService.get({
334 request,
335 response,
336 params: { communityId },
337 });
338
339 if (!permissions.access) {
340 throw new Unauthorized();
341 }
342 await checkoutTenant(authId, communityId);
343 const record = await findUser(communityId, authId);
344 if (record) {
345 return record;
346 }
347 const user = await createUser({
348 accountId: communityId,
349 authId,
350 displayName,
351 profileImageUrl,
352 });
353 await createChannelMemberships(communityId, user.id);
354 return user;
355}
356
357export async function inviteNewMembers({
358 emails = [],

Callers 1

auth.tsFile · 0.90

Calls 5

checkoutTenantFunction · 0.85
createChannelMembershipsFunction · 0.85
findUserFunction · 0.70
createUserFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected