Relax username length requirement and remove nickname

This commit is contained in:
Tim
2025-07-16 19:51:55 +08:00
parent ee25ba8ec6
commit 1e14fb21bb
4 changed files with 24 additions and 12 deletions

View File

@@ -14,8 +14,8 @@ public class UsernameValidator {
* @param username the username to validate
*/
public void validate(String username) {
if (username == null || username.length() < 6) {
throw new FieldException("username", "Username must be at least 6 characters long");
if (username == null || username.isEmpty()) {
throw new FieldException("username", "Username cannot be empty");
}
}
}