Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.

allow numeric usernames less than MAX_INT64 during registration #3137

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions clientapi/routing/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,6 @@ func Register(
return handleGuestRegistration(req, r, cfg, userAPI)
}

// Don't allow numeric usernames less than MAX_INT64.
if _, err = strconv.ParseInt(r.Username, 10, 64); err == nil {
return util.JSONResponse{
Code: http.StatusBadRequest,
JSON: spec.InvalidUsername("Numeric user IDs are reserved"),
}
}
// Auto generate a numeric username if r.Username is empty
if r.Username == "" {
nreq := &userapi.QueryNumericLocalpartRequest{
Expand Down
1 change: 1 addition & 0 deletions sytest-whitelist
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ PUT /rooms/:room_id/redact/:event_id/:txn_id is idempotent
Unnamed room comes with a name summary
Named room comes with just joined member count summary
Room summary only has 5 heroes
registration is idempotent, without username specified
registration is idempotent, with username specified
Setting state twice is idempotent
Joining room twice is idempotent
Expand Down
Loading