Skip to content

Commit

Permalink
fix(api): 🐛 Also validate other username characters in username changes
Browse files Browse the repository at this point in the history
  • Loading branch information
CPlusPatch committed Nov 21, 2024
1 parent 2fea17f commit 66c5c6e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/api/v1/accounts/update_credentials/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit 66c5c6e

Please sign in to comment.