minor fix

This commit is contained in:
Daniel 2023-07-19 18:38:36 -04:00
parent 985687ca89
commit a45774a479
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ export default async function updateUser(
const checkUsername = RegExp("^[a-z0-9_-]{3,31}$");
if (!checkUsername.test(user.username))
if (!checkUsername.test(user.username.toLowerCase()))
return {
response:
"Username has to be between 3-30 characters, no spaces and special characters are allowed.",

View File

@ -33,7 +33,7 @@ export default async function Index(
const checkUsername = RegExp("^[a-z0-9_-]{3,31}$");
if (!emailEnabled && !checkUsername.test(body.username || ""))
if (!emailEnabled && !checkUsername.test(body.username?.toLowerCase() || ""))
return res.status(400).json({
response:
"Username has to be between 3-30 characters, no spaces and special characters are allowed.",