summary refs log tree commit diff
path: root/src/api/routes/users/@me/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/routes/users/@me/index.ts')
-rw-r--r--src/api/routes/users/@me/index.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/api/routes/users/@me/index.ts b/src/api/routes/users/@me/index.ts
index 0d3c3135..30091344 100644
--- a/src/api/routes/users/@me/index.ts
+++ b/src/api/routes/users/@me/index.ts
@@ -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) {