1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-23 02:42:28 +01:00

Merge pull request from GHSA-r7h4-76f7-6264

* Actually use maxUsername config value.

* Change maxUsername default to discord.com default
This commit is contained in:
Madeline 2023-02-02 22:15:03 +11:00 committed by GitHub
parent da20866967
commit af6b5a6594
2 changed files with 11 additions and 1 deletions

View File

@ -129,6 +129,16 @@ router.patch(
},
});
}
const { maxUsername } = Config.get().limits.user;
if (check_username.length > maxUsername) {
throw FieldErrors({
username: {
code: "USERNAME_INVALID",
message: `Username must be less than ${maxUsername} in length`,
},
});
}
}
if (body.discriminator) {

View File

@ -18,6 +18,6 @@
export class UserLimits {
maxGuilds: number = 1048576;
maxUsername: number = 127;
maxUsername: number = 32;
maxFriends: number = 5000;
}