From d4f160d959aee0be01dd852cc3ec62a663b3bb4c Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sat, 20 Aug 2022 07:58:42 +0300 Subject: [PATCH] updated the user and admin login email validator to check only the string format --- forms/admin_login.go | 2 +- forms/user_email_login.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/forms/admin_login.go b/forms/admin_login.go index 89c6ff15..09cf4f97 100644 --- a/forms/admin_login.go +++ b/forms/admin_login.go @@ -56,7 +56,7 @@ func NewAdminLoginWithConfig(config AdminLoginConfig) *AdminLogin { // Validate makes the form validatable by implementing [validation.Validatable] interface. func (form *AdminLogin) Validate() error { return validation.ValidateStruct(form, - validation.Field(&form.Email, validation.Required, validation.Length(1, 255), is.Email), + validation.Field(&form.Email, validation.Required, validation.Length(1, 255), is.EmailFormat), validation.Field(&form.Password, validation.Required, validation.Length(1, 255)), ) } diff --git a/forms/user_email_login.go b/forms/user_email_login.go index 1b8d73a9..122f50c9 100644 --- a/forms/user_email_login.go +++ b/forms/user_email_login.go @@ -55,7 +55,7 @@ func NewUserEmailLoginWithConfig(config UserEmailLoginConfig) *UserEmailLogin { // Validate makes the form validatable by implementing [validation.Validatable] interface. func (form *UserEmailLogin) Validate() error { return validation.ValidateStruct(form, - validation.Field(&form.Email, validation.Required, validation.Length(1, 255), is.Email), + validation.Field(&form.Email, validation.Required, validation.Length(1, 255), is.EmailFormat), validation.Field(&form.Password, validation.Required, validation.Length(1, 255)), ) }