summaryrefslogtreecommitdiffstats
path: root/model/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/user.go')
-rw-r--r--model/user.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/model/user.go b/model/user.go
index b2b077e5f..8e02fe1ab 100644
--- a/model/user.go
+++ b/model/user.go
@@ -29,6 +29,8 @@ const (
USER_FIRST_NAME_MAX_RUNES = 64
USER_LAST_NAME_MAX_RUNES = 64
USER_AUTH_DATA_MAX_LENGTH = 128
+ USER_NAME_MAX_LENGTH = 64
+ USER_NAME_MIN_LENGTH = 3
)
type User struct {
@@ -487,7 +489,7 @@ var restrictedUsernames = []string{
}
func IsValidUsername(s string) bool {
- if len(s) == 0 || len(s) > 64 {
+ if len(s) < USER_NAME_MIN_LENGTH || len(s) > USER_NAME_MAX_LENGTH {
return false
}