mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 23:33:31 +00:00
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"
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user