@@ -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()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user