From f67115a788d1e8a10957c517902d23f84e868915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Sun, 19 Feb 2023 19:41:20 +0100 Subject: [PATCH] fix: disallow blank space usernames --- models/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user.go b/models/user.go index c46c88d..e1929e0 100644 --- a/models/user.go +++ b/models/user.go @@ -185,7 +185,7 @@ func (r *UserDataUpdate) IsValid() bool { } func ValidateUsername(username string) bool { - return len(username) >= 1 && username != "current" + return len(username) >= 1 && username != "current" && !strings.Contains(username, " ") } func ValidatePassword(password string) bool {