Skip to content

Commit

Permalink
replaced MX email validator with email format only
Browse files Browse the repository at this point in the history
  • Loading branch information
ganigeorgiev committed Sep 1, 2022
1 parent 07ac5bf commit 06a7f1a
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion core/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func (c MetaConfig) Validate() error {
validation.Field(&c.AppName, validation.Required, validation.Length(1, 255)),
validation.Field(&c.AppUrl, validation.Required, is.URL),
validation.Field(&c.SenderName, validation.Required, validation.Length(1, 255)),
validation.Field(&c.SenderAddress, is.Email, validation.Required),
validation.Field(&c.SenderAddress, is.EmailFormat, validation.Required),
validation.Field(&c.VerificationTemplate, validation.Required),
validation.Field(&c.ResetPasswordTemplate, validation.Required),
validation.Field(&c.ConfirmEmailChangeTemplate, validation.Required),
Expand Down
2 changes: 1 addition & 1 deletion forms/admin_password_reset_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (form *AdminPasswordResetRequest) Validate() error {
&form.Email,
validation.Required,
validation.Length(1, 255),
is.Email,
is.EmailFormat,
),
)
}
Expand Down
2 changes: 1 addition & 1 deletion forms/admin_upsert.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (form *AdminUpsert) Validate() error {
&form.Email,
validation.Required,
validation.Length(1, 255),
is.Email,
is.EmailFormat,
validation.By(form.checkUniqueEmail),
),
validation.Field(
Expand Down
2 changes: 1 addition & 1 deletion forms/test_email_send.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (form *TestEmailSend) Validate() error {
&form.Email,
validation.Required,
validation.Length(1, 255),
is.Email,
is.EmailFormat,
),
validation.Field(
&form.Template,
Expand Down
2 changes: 1 addition & 1 deletion forms/user_email_change_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (form *UserEmailChangeRequest) Validate() error {
&form.NewEmail,
validation.Required,
validation.Length(1, 255),
is.Email,
is.EmailFormat,
validation.By(form.checkUniqueEmail),
),
)
Expand Down
2 changes: 1 addition & 1 deletion forms/user_password_reset_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (form *UserPasswordResetRequest) Validate() error {
&form.Email,
validation.Required,
validation.Length(1, 255),
is.Email,
is.EmailFormat,
),
)
}
Expand Down
2 changes: 1 addition & 1 deletion forms/user_upsert.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (form *UserUpsert) Validate() error {
&form.Email,
validation.Required,
validation.Length(1, 255),
is.Email,
is.EmailFormat,
validation.By(form.checkEmailDomain),
validation.By(form.checkUniqueEmail),
),
Expand Down
2 changes: 1 addition & 1 deletion forms/user_verification_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (form *UserVerificationRequest) Validate() error {
&form.Email,
validation.Required,
validation.Length(1, 255),
is.Email,
is.EmailFormat,
),
)
}
Expand Down
2 changes: 1 addition & 1 deletion forms/validators/record_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (validator *RecordDataValidator) checkEmailValue(field *schema.SchemaField,
return nil // nothing to check
}

if is.Email.Validate(val) != nil {
if is.EmailFormat.Validate(val) != nil {
return validation.NewError("validation_invalid_email", "Must be a valid email")
}

Expand Down

0 comments on commit 06a7f1a

Please sign in to comment.