Skip to content

Commit

Permalink
set handle minimum size
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Jan 1, 2024
1 parent 076eafc commit 78167a8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/internal/httphandlers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ func (s *httpImpl) Registration(w http.ResponseWriter, r *http.Request) {
}

handle = strings.ToLower(handle)
if len(handle) <= 2 {
w.WriteHeader(http.StatusBadRequest)
return
}

for i := 0; i < len(handle); i++ {
c := rune(handle[i])
if !helpers.Contains(AVAILABLE_HANDLE_CHARS, c) {
Expand Down

0 comments on commit 78167a8

Please sign in to comment.