Skip to content

Commit

Permalink
update login email regex check
Browse files Browse the repository at this point in the history
  • Loading branch information
maidul98 committed Nov 21, 2022
1 parent e188524 commit 3689d75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/packages/cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ func init() {

func askForLoginCredentials() (email string, password string, err error) {
validateEmail := func(input string) error {
result, err := regexp.MatchString("^\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$", input)
if err != nil || !result {
matched, err := regexp.MatchString("^[\\w!#$%&'*+/=?`{|}~^-]+(?:\\.[\\w!#$%&'*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$", input)
if err != nil || !matched {
return errors.New("this doesn't look like an email address")
}
return nil
Expand Down

0 comments on commit 3689d75

Please sign in to comment.