Account for reset names that are outside of usual bounds
This commit is contained in:
@@ -75,14 +75,22 @@ export async function onRequestPost(context: RequestContext) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (const username of usernames) {
|
for (const username of usernames) {
|
||||||
|
// Roblox thought this name was inappropriate, the standard username rules may not apply.
|
||||||
|
const isResetUsername = username.match(/roblox_user_\d+/);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
username.length < 3 ||
|
!isResetUsername &&
|
||||||
username.length > 20 ||
|
(username.length < 3 ||
|
||||||
(username.match(/_/g)?.length > 1 &&
|
username.length > 20 ||
|
||||||
!username.match(/roblox_user_\d+/)) || // New reset username format, the only exception to the underscore rule
|
username.match(/_/g)?.length > 1 ||
|
||||||
username.match(/\W/)
|
username.match(/\W/))
|
||||||
)
|
)
|
||||||
return jsonError(`Username "${username}" is invalid`, 400);
|
return jsonError(`Username "${username}" is invalid`, 400);
|
||||||
|
else if (isResetUsername && username.length > 30)
|
||||||
|
return jsonError(
|
||||||
|
`Username "${username}" is not a valid reset username`,
|
||||||
|
400,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const rbxSearchReq = await fetch(
|
const rbxSearchReq = await fetch(
|
||||||
|
|||||||
Reference in New Issue
Block a user