Skip to content

Commit

Permalink
Add check if username is only numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-ntrf committed Mar 24, 2021
1 parent adca7d4 commit 768f351
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/signup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 768f351

Please sign in to comment.