add user load name length check
This commit is contained in:
parent
586b97e17b
commit
21b18d9809
1 changed files with 1 additions and 1 deletions
|
@ -79,7 +79,7 @@ public class User {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean fromJson(JsonObject obj) {
|
private boolean fromJson(JsonObject obj) {
|
||||||
if(!Formatter.isValidUser(this.username))
|
if(this.username.length() < 3 || this.username.length() > 16 || !Formatter.isValidUser(this.username))
|
||||||
return false;
|
return false;
|
||||||
this.hash = obj.has("passwordHash") ? Formatter.fromHexString(obj.get("passwordHash").getAsString()) : null;
|
this.hash = obj.has("passwordHash") ? Formatter.fromHexString(obj.get("passwordHash").getAsString()) : null;
|
||||||
this.salt = obj.has("passwordSalt") ? Formatter.fromHexString(obj.get("passwordSalt").getAsString()) : null;
|
this.salt = obj.has("passwordSalt") ? Formatter.fromHexString(obj.get("passwordSalt").getAsString()) : null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue