mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 00:18: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()
|
||||
.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)),
|
||||
|
|
|
|||
Loading…
Reference in a new issue