Skip to content

Commit

Permalink
Email Validation - new pattern
Browse files Browse the repository at this point in the history
@ included
  • Loading branch information
MHSanaei committed Sep 12, 2024
1 parent 374d49e commit 3e7c783
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/service/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -2031,9 +2031,9 @@ func validateEmail(email string) (bool, error) {
return false, errors.New("email contains uppercase letters, please convert to lowercase")
}

emailPattern := `^[a-z0-9._-]+$`
emailPattern := `^[a-z0-9@._-]+$`
if !regexp.MustCompile(emailPattern).MatchString(email) {
return false, errors.New("email contains invalid characters, please use only lowercase letters, digits, dots, dashes, and underscores")
return false, errors.New("email contains invalid characters, please use only lowercase letters, digits, and @._-")
}

return true, nil
Expand Down

4 comments on commit 3e7c783

@090ebier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

چرا روی اسم ایمیل الگوی جدید تعریف شده الان کلیه کاربرا رو باید به حروف کوچیک تبدیل کنیم؟ نمیشه این محدودیت برداشته بشه؟

@MHSanaei
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

خیر این محدودیت یاید از اول وجود میداشت، نبودش کلی مشکل بوجود میاورد که از ورژن ۲.۴‌.۰ دیگه اون مشکلات وجود نخواهد داشت.

@OghabTeam
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

سلام لطفا الگوی جدید رو بردارید ما نیاز داریم که یوزر با نام کلمات بزرگ و همچنین علامت | بسازیم.

@MHSanaei
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OghabTeam
از موارد موجود استفاده کنید
a-z
0-9
@._-

Please sign in to comment.