diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts index beb6715b3..5c63f1df7 100644 --- a/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts +++ b/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts @@ -352,11 +352,14 @@ export class SignInUpService { } }; + const isWorkEmailFound = isWorkEmail(email); const logo = - isWorkEmail(email) && (await isLogoUrlValid()) ? logoUrl : undefined; + isWorkEmailFound && (await isLogoUrlValid()) ? logoUrl : undefined; const workspaceToCreate = this.workspaceRepository.create({ - subdomain: await this.domainManagerService.generateSubdomain(), + subdomain: await this.domainManagerService.generateSubdomain( + isWorkEmailFound ? { email } : {}, + ), displayName: '', inviteHash: v4(), activationStatus: WorkspaceActivationStatus.PENDING_CREATION,