Scheduling infrastructure for absolutely everyone.
fix: organization user shouldn't be asked for payment for a premium username (#13535)
Hariom Balhara473012f2c050
diff --git a/packages/lib/server/username.ts b/packages/lib/server/username.tsindex 0cd23bad782..cc5abc01766 100644--- a/packages/lib/server/username.ts+++ b/packages/lib/server/username.ts@@ -181,12 +181,11 @@ const usernameCheckForSignup = async ({const user = await prisma.user.findFirst({where: {email,- // Simply remove it when we drop organizationId column- organizationId: null,},select: {id: true,username: true,+ organizationId: true,},});@@ -206,13 +205,15 @@ const usernameCheckForSignup = async ({// When we invite an email, that doesn't match the orgAutoAcceptEmail, we create a user with organizationId=null.// The only way to differentiate b/w 'a new email that was invited to an Org' and 'a user that was created using regular signup' is to check if the user is a member of an org.+ // If username is in global namespaceif (!userIsAMemberOfAnOrg) {response.available = false;+ // There are no premium users outside an organization only+ response.premium = await isPremiumUserName(username);}- }-- if (await isPremiumUserName(username)) {- response.premium = true;+ } else {+ // If user isn't found, it's a new signup and that can't be of an organization+ response.premium = await isPremiumUserName(username);}// get list of similar usernames in the db