mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(api): 🐛 Also validate other username characters in username changes
This commit is contained in:
parent
2fea17fdaa
commit
66c5c6e62d
|
|
@ -47,6 +47,10 @@ export const schemas = {
|
||||||
.trim()
|
.trim()
|
||||||
.max(config.validation.max_username_size)
|
.max(config.validation.max_username_size)
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
|
.regex(
|
||||||
|
/^[a-z0-9_-]+$/,
|
||||||
|
"Username can only contain letters, numbers, underscores and hyphens",
|
||||||
|
)
|
||||||
.refine(
|
.refine(
|
||||||
(s) =>
|
(s) =>
|
||||||
!config.filters.username.some((filter) => s.match(filter)),
|
!config.filters.username.some((filter) => s.match(filter)),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue