fix: update project disabled messages for clarity and consistency

This commit is contained in:
Dries Augustyns
2026-04-24 19:21:07 +02:00
parent 1c89ed083e
commit d7eb85ffdd
10 changed files with 84 additions and 68 deletions
+10 -2
View File
@@ -52,7 +52,15 @@ export class Domains {
const isDisabled = await SecurityService.isProjectDisabled(projectId);
if (isDisabled) {
throw new NotAllowed(
'Cannot add domains to a disabled project. Please contact support to resolve security violations before making changes.',
'This project has been disabled. Please contact support for assistance.',
);
}
// Block subdomains whose root domain belongs to a disabled project
const rootCheck = await DomainService.checkSubdomainOfDisabledRoot(domain);
if (rootCheck.blocked) {
throw new NotAllowed(
'This domain cannot be added at this time. Please contact support for assistance.',
);
}
@@ -138,7 +146,7 @@ export class Domains {
const isDisabled = await SecurityService.isProjectDisabled(domain.projectId);
if (isDisabled) {
throw new NotAllowed(
'Cannot remove domains from a disabled project. Please contact support to resolve security violations before making changes.',
'This project has been disabled. Please contact support for assistance.',
);
}
+3 -3
View File
@@ -68,7 +68,7 @@ export class Users {
if (hasDisabledProject) {
throw new HttpException(
403,
`You cannot create new projects while you are a member of disabled projects: ${disabledProjectNames.join(', ')}. Please contact support to resolve security violations.`,
`You cannot create new projects at this time. Please contact support for assistance.`,
ErrorCode.PROJECT_DISABLED,
);
}
@@ -615,7 +615,7 @@ export class Users {
if (isDisabled) {
throw new HttpException(
403,
'Cannot reset a disabled project. Please contact support to resolve security violations before making changes.',
'This project has been disabled. Please contact support for assistance.',
ErrorCode.PROJECT_DISABLED,
);
}
@@ -703,7 +703,7 @@ export class Users {
if (project.disabled) {
throw new HttpException(
403,
'Cannot delete a disabled project. Please contact support to resolve security violations.',
'This project has been disabled. Please contact support for assistance.',
ErrorCode.PROJECT_DISABLED,
);
}