Prevent incorrect username registration

This commit is contained in:
Jesse Wierzbinski 2024-04-08 22:40:57 -10:00
parent 39a365e15a
commit b5f31fc4e4
No known key found for this signature in database

View file

@ -88,10 +88,11 @@ export default apiRoute<{
} }
// Check if username is valid // Check if username is valid
if (!body.username?.match(/^[a-zA-Z0-9_]+$/)) if (!body.username?.match(/^[a-z0-9_]+$/))
errors.details.username.push({ errors.details.username.push({
error: "ERR_INVALID", 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 // Check if username doesnt match filters