1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-05 10:22:31 +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 d8f32cb05a
commit a03f7c8948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}