Fix validator

Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
Émile Ré
2025-12-15 13:01:52 +01:00
parent 81cb0de8f2
commit 729551beac
2 changed files with 2 additions and 2 deletions

View File

@@ -58,7 +58,7 @@ const (
func (tcar *TrustCenterAccessRequest) Validate() error { func (tcar *TrustCenterAccessRequest) Validate() error {
v := validator.New() v := validator.New()
v.Check(tcar.Email, "email", validator.NotBlacklisted()) v.Check(tcar.Email.Domain(), "email", validator.NotBlacklisted())
return v.Error() return v.Error()
} }

View File

@@ -35,7 +35,7 @@ func NotBlacklisted() ValidatorFunc {
return func(value any) *ValidationError { return func(value any) *ValidationError {
err := notOneOfSlice(value) err := notOneOfSlice(value)
if err == nil { if err != nil {
return newValidationError( return newValidationError(
ErrorCodeInvalidEmail, ErrorCodeInvalidEmail,
"must not be blacklisted", "must not be blacklisted",