diff --git a/functions/api/reports/submit.ts b/functions/api/reports/submit.ts index 2da683e..af37b2f 100644 --- a/functions/api/reports/submit.ts +++ b/functions/api/reports/submit.ts @@ -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(