From 768f3511428129e31e5a49d5e78d4f1ee901a885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix-Antoine=20Fortin?= Date: Wed, 24 Mar 2021 09:04:15 -0400 Subject: [PATCH] Add check if username is only numbers --- server/signup.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/signup.go b/server/signup.go index 128b830..6ed51c0 100644 --- a/server/signup.go +++ b/server/signup.go @@ -136,6 +136,10 @@ func (h *Handler) createAccount(uid, email, email2, first, last, pass, pass2, ca return errors.New("Please provide a username") } + if valid.IsNumeric(uid) { + return errors.New("Username must include at least one letter") + } + if !valid.IsAlphanumeric(uid) { return errors.New("Username must be alpha numeric") }