Account for reset names that are outside of usual bounds

This commit is contained in:
2026-02-16 18:31:53 -05:00
parent 25c9049563
commit e5a00d69a6

View File

@@ -75,14 +75,22 @@ export async function onRequestPost(context: RequestContext) {
);
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 (
username.length < 3 ||
username.length > 20 ||
(username.match(/_/g)?.length > 1 &&
!username.match(/roblox_user_\d+/)) || // New reset username format, the only exception to the underscore rule
username.match(/\W/)
!isResetUsername &&
(username.length < 3 ||
username.length > 20 ||
username.match(/_/g)?.length > 1 ||
username.match(/\W/))
)
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(