fix: Add reserved subdomains constant and update validation on generateSubdomain (#15217)

## Description

Fixes #15160 

- Moved the reserved subdomains to a separate shared constant file:
`packages/twenty-server/src/engine/core-modules/workspace/constants/reserved-subdomains.constant.ts`
- Updated the validation while generating subdomain to check if the
extracted subdomain (from email or display name) is reserved
- When a reserved subdomain is detected, the server will automatically
fall back to a random subdomain

---------

Co-authored-by: Naineel Soyantar <naineelsoyantar@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Naineel Soyantar
2025-10-21 20:23:48 +05:30
committed by GitHub
parent 139b6dd29b
commit 26e432d8e2
97 changed files with 1369 additions and 754 deletions
@@ -4,7 +4,7 @@ import { TypeOrmModule } from '@nestjs/typeorm';
import { AiModule } from 'src/engine/core-modules/ai/ai.module';
import { AuditModule } from 'src/engine/core-modules/audit/audit.module';
import { TokenModule } from 'src/engine/core-modules/auth/token/token.module';
import { DomainManagerModule } from 'src/engine/core-modules/domain-manager/domain-manager.module';
import { WorkspaceDomainsModule } from 'src/engine/core-modules/domain/workspace-domains/workspace-domains.module';
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
import { FileEntity } from 'src/engine/core-modules/file/entities/file.entity';
import { FileUploadModule } from 'src/engine/core-modules/file/file-upload/file-upload.module';
@@ -68,7 +68,7 @@ import { AgentActorContextService } from './services/agent-actor-context.service
WorkspacePermissionsCacheModule,
WorkspaceCacheStorageModule,
TokenModule,
DomainManagerModule,
WorkspaceDomainsModule,
WorkflowToolsModule,
UserWorkspaceModule,
UserRoleModule,