Currently username can be any matching regex:/^[a-z0-9_-]+$/i and the other rules (eg, min: 3). A drawback of this regex is that it allows for numeric usernames. As a consequence consider:
User
- id: 1337 username: Toby
- id: 1338 username: 1337
Hitting
/api/user/1337 returns user 1337 for any other user.
What we have to do is disallow any numeric usernames, the UserValidator has to be modified. A consideration is what to do with existing users.
Currently username can be any matching
regex:/^[a-z0-9_-]+$/iand the other rules (eg, min: 3). A drawback of this regex is that it allows for numeric usernames. As a consequence consider:User
Hitting
/api/user/1337 returns user 1337 for any other user.
What we have to do is disallow any numeric usernames, the UserValidator has to be modified. A consideration is what to do with existing users.