We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 45aabdc commit 79bc20dCopy full SHA for 79bc20d
1 file changed
auth/users.go
@@ -12,14 +12,14 @@ import (
12
"github.com/retrixe/octyne/system"
13
)
14
15
-var validUsernameRegex = regexp.MustCompile(`^[a-zA-Z0-9_@]+$`)
+var validUsernameRegex = regexp.MustCompile(`^[a-zA-Z0-9_\-@]+$`)
16
17
func ValidateUsername(username string) string {
18
if username == "@local" {
19
return "The username '@local' is reserved for local system users."
20
} else if !validUsernameRegex.MatchString(username) {
21
return "The username '" + username + "' is invalid." +
22
- " A valid username can contain only letters, numbers, _ or @."
+ " A valid username can contain only letters, numbers, -, _ or @."
23
}
24
return ""
25
0 commit comments