From 98917ce06d69e98a3acb688654a587ebfc4b380a Mon Sep 17 00:00:00 2001 From: Jared Snider Date: Thu, 8 Dec 2022 16:15:13 -0500 Subject: [PATCH] SG-680 - Updated Domain Name custom validator to pass back error message in format the error.component.ts expected so it can be displayed without an untranslated error prefix of "invalidDomainName" --- .../domain-add-edit-dialog/domain-name.validator.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bitwarden_license/bit-web/src/app/organizations/manage/domain-verification/domain-add-edit-dialog/domain-name.validator.ts b/bitwarden_license/bit-web/src/app/organizations/manage/domain-verification/domain-add-edit-dialog/domain-name.validator.ts index 42cda449f8c..92fd8513860 100644 --- a/bitwarden_license/bit-web/src/app/organizations/manage/domain-verification/domain-add-edit-dialog/domain-name.validator.ts +++ b/bitwarden_license/bit-web/src/app/organizations/manage/domain-verification/domain-add-edit-dialog/domain-name.validator.ts @@ -11,7 +11,11 @@ export function domainNameValidator(errorMessage: string): ValidatorFn { const forbiddenPatterns = [/^https:\/\//, /^http:\/\//, /^www\./]; for (const pattern of forbiddenPatterns) { if (pattern.test(control.value)) { - return { invalidDomainName: errorMessage }; + return { + invalidDomainName: { + message: errorMessage, + }, + }; } } return null;