mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 11:26:33 +00:00
update login email regex check
This commit is contained in:
@@ -114,8 +114,8 @@ func init() {
|
|||||||
|
|
||||||
func askForLoginCredentials() (email string, password string, err error) {
|
func askForLoginCredentials() (email string, password string, err error) {
|
||||||
validateEmail := func(input string) error {
|
validateEmail := func(input string) error {
|
||||||
result, err := regexp.MatchString("^\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$", input)
|
matched, err := regexp.MatchString("^[\\w!#$%&'*+/=?`{|}~^-]+(?:\\.[\\w!#$%&'*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$", input)
|
||||||
if err != nil || !result {
|
if err != nil || !matched {
|
||||||
return errors.New("this doesn't look like an email address")
|
return errors.New("this doesn't look like an email address")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user