fix(api): 🐛 Also validate other username characters in username changes

This commit is contained in:
Jesse Wierzbinski 2024-11-21 09:31:37 +01:00
parent 2fea17fdaa
commit 66c5c6e62d
No known key found for this signature in database

View file

@ -47,6 +47,10 @@ export const schemas = {
.trim()
.max(config.validation.max_username_size)
.toLowerCase()
.regex(
/^[a-z0-9_-]+$/,
"Username can only contain letters, numbers, underscores and hyphens",
)
.refine(
(s) =>
!config.filters.username.some((filter) => s.match(filter)),