Merge remote-tracking branch 'Vespe-r/fix/pronouns_length_limit'

This commit is contained in:
Rory&
2026-08-30 06:30:53 +02:00
4 changed files with 13 additions and 0 deletions
+12
View File
@@ -187,6 +187,18 @@ router.patch("/", route({ requestBody: "UserProfileModifySchema" }), async (req:
}
}
if (body.pronouns) {
const { maxPronouns } = Config.get().limits.user;
if (body.pronouns.length > maxPronouns) {
throw FieldErrors({
pronouns: {
code: "PRONOUNS_INVALID",
message: `Pronouns must be less than ${maxPronouns} in length`,
},
});
}
}
user.assign(body);
await user.save();