From 1cabbaa3e8c717c7dde8f0f05f242c32571bcfc9 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sat, 13 Jul 2024 21:39:07 +0200 Subject: [PATCH] fix(server): not being able to view profiles which had a dot in the name --- backend/src/api/routes/users.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/src/api/routes/users.ts b/backend/src/api/routes/users.ts index 92c8b0979..bce4515ac 100644 --- a/backend/src/api/routes/users.ts +++ b/backend/src/api/routes/users.ts @@ -514,9 +514,13 @@ router.get( withApeRateLimiter(RateLimit.userProfileGet), validateRequest({ params: { - uidOrName: joi - .alternatives() - .try(usernameValidation, joi.string().token().max(50)), + uidOrName: joi.alternatives().try( + joi + .string() + .regex(/^[\da-zA-Z._-]+$/) + .max(16), + joi.string().token().max(50) + ), }, query: { isUid: joi.string().valid("").messages({