diff --git a/apps/web/pages/api/auth/signup.ts b/apps/web/pages/api/auth/signup.ts index 4956b9ae8c1388..4004aa5418569d 100644 --- a/apps/web/pages/api/auth/signup.ts +++ b/apps/web/pages/api/auth/signup.ts @@ -130,16 +130,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) // Accept any child team invites for orgs and create a membership for the org itself if (team.parentId) { - // Create a membership for the organization itself - await prisma.membership.create({ - data: { - userId: user.id, - teamId: team.parentId, - accepted: true, - role: MembershipRole.MEMBER, - }, - }); - // We do a membership update twice so we can join the ORG invite if the user is invited to a team witin a ORG await prisma.membership.updateMany({ where: { diff --git a/apps/web/pages/signup.tsx b/apps/web/pages/signup.tsx index 781072c297e645..d9815255840a65 100644 --- a/apps/web/pages/signup.tsx +++ b/apps/web/pages/signup.tsx @@ -302,7 +302,7 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => { const isOrganization = tokenTeam.metadata?.isOrganization || tokenTeam?.parentId !== null; // If we are dealing with an org, the slug may come from the team itself or its parent const orgSlug = isOrganization - ? tokenTeam.slug || tokenTeam.metadata?.requestedSlug || tokenTeam.parent?.slug + ? tokenTeam.metadata?.requestedSlug || tokenTeam.parent?.slug || tokenTeam.slug : null; // Org context shouldn't check if a username is premium diff --git a/packages/trpc/server/routers/viewer/teams/inviteMember/utils.ts b/packages/trpc/server/routers/viewer/teams/inviteMember/utils.ts index 69be175e5ce08f..370e975901eacf 100644 --- a/packages/trpc/server/routers/viewer/teams/inviteMember/utils.ts +++ b/packages/trpc/server/routers/viewer/teams/inviteMember/utils.ts @@ -257,7 +257,7 @@ export async function sendVerificationEmail({ expires: new Date(new Date().setHours(168)), // +1 week team: { connect: { - id: connectionInfo.orgId || input.teamId, + id: input.teamId, }, }, },