enable dot(.) in usernames

This commit is contained in:
Brad Rydzewski 2017-10-05 14:02:23 -07:00
parent 8125f97c21
commit 3529dda2ba
2 changed files with 5 additions and 1 deletions

View file

@ -6,7 +6,7 @@ import (
)
// validate a username (e.g. from github)
var reUsername = regexp.MustCompile("^[a-zA-Z0-9-_]+$")
var reUsername = regexp.MustCompile("^[a-zA-Z0-9-_.]+$")
var errUserLoginInvalid = errors.New("Invalid User Login")

View file

@ -35,6 +35,10 @@ func TestUserValidate(t *testing.T) {
user: User{Login: "john_smith"},
err: nil,
},
{
user: User{Login: "john.smith"},
err: nil,
},
}
for _, test := range tests {