Skip to content

Commit 79bc20d

Browse files
committed
Allow hyphens in usernames
1 parent 45aabdc commit 79bc20d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

auth/users.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import (
1212
"github.com/retrixe/octyne/system"
1313
)
1414

15-
var validUsernameRegex = regexp.MustCompile(`^[a-zA-Z0-9_@]+$`)
15+
var validUsernameRegex = regexp.MustCompile(`^[a-zA-Z0-9_\-@]+$`)
1616

1717
func ValidateUsername(username string) string {
1818
if username == "@local" {
1919
return "The username '@local' is reserved for local system users."
2020
} else if !validUsernameRegex.MatchString(username) {
2121
return "The username '" + username + "' is invalid." +
22-
" A valid username can contain only letters, numbers, _ or @."
22+
" A valid username can contain only letters, numbers, -, _ or @."
2323
}
2424
return ""
2525
}

0 commit comments

Comments
 (0)