Skip to content

Commit

Permalink
chore: add TLD in username of managed users (calcom#18229)
Browse files Browse the repository at this point in the history
* chore: add TLD in username of managed users

* fixup! chore: add TLD in username of managed users

* bump platform libraries
  • Loading branch information
ThyMinimalDev authored and MuhammadAimanSulaiman committed Jan 10, 2025
1 parent ebb2522 commit e292d0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/api/v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@axiomhq/winston": "^1.2.0",
"@calcom/platform-constants": "*",
"@calcom/platform-enums": "*",
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.72",
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.73",
"@calcom/platform-libraries-0.0.2": "npm:@calcom/platform-libraries@0.0.2",
"@calcom/platform-types": "*",
"@calcom/platform-utils": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,13 @@ export async function createNewUsersConnectToOrgIfExists({
// Weird but orgId is defined only if the invited user email matches orgAutoAcceptEmail
const { orgId, autoAccept } = orgConnectInfoByUsernameOrEmail[invitation.usernameOrEmail];
const [emailUser, emailDomain] = invitation.usernameOrEmail.split("@");
const [domainName, TLD] = emailDomain.split(".");

// An org member can't change username during signup, so we set the username
const orgMemberUsername =
emailDomain === autoAcceptEmailDomain
? slugify(emailUser)
: slugify(`${emailUser}-${emailDomain.split(".")[0]}`);
: slugify(`${emailUser}-${domainName}${isPlatformManaged ? `-${TLD}` : ""}`);

// As a regular team member is allowed to change username during signup, we don't set any username for him
const regularTeamMemberUsername = null;
Expand Down

0 comments on commit e292d0a

Please sign in to comment.