From b5f31fc4e44c92bba0e4c8c8d63369a453c2c177 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Mon, 8 Apr 2024 22:40:57 -1000 Subject: [PATCH] Prevent incorrect username registration --- server/api/api/v1/accounts/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/api/api/v1/accounts/index.ts b/server/api/api/v1/accounts/index.ts index 09cde002..7c9a90a8 100644 --- a/server/api/api/v1/accounts/index.ts +++ b/server/api/api/v1/accounts/index.ts @@ -88,10 +88,11 @@ export default apiRoute<{ } // Check if username is valid - if (!body.username?.match(/^[a-zA-Z0-9_]+$/)) + if (!body.username?.match(/^[a-z0-9_]+$/)) errors.details.username.push({ error: "ERR_INVALID", - description: "must only contain letters, numbers, and underscores", + description: + "must only contain lowercase letters, numbers, and underscores", }); // Check if username doesnt match filters