mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Prevent incorrect username registration
This commit is contained in:
parent
39a365e15a
commit
b5f31fc4e4
|
|
@ -88,10 +88,11 @@ export default apiRoute<{
|
|||
}
|
||||
|
||||
// Check if username is valid
|
||||
if (!body.username?.match(/^[a-zA-Z0-9_]+$/))
|
||||
if (!body.username?.match(/^[a-z0-9_]+$/))
|
||||
errors.details.username.push({
|
||||
error: "ERR_INVALID",
|
||||
description: "must only contain letters, numbers, and underscores",
|
||||
description:
|
||||
"must only contain lowercase letters, numbers, and underscores",
|
||||
});
|
||||
|
||||
// Check if username doesnt match filters
|
||||
|
|
|
|||
Loading…
Reference in a new issue