fix(server): not being able to view profiles which had a dot in the name

This commit is contained in:
Miodec 2024-07-13 21:39:07 +02:00
parent 16f248d9de
commit 1cabbaa3e8

View file

@ -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({