feat: validate maxSessions input in settings update handler

- Added validation to ensure maxSessions is an integer before processing the request.
- Responds with a 400 status and an error message if the input is not a valid integer.
This commit is contained in:
SuperComboGamer
2025-12-20 23:18:13 -05:00
parent 0e944e274a
commit 39b21830dc
2 changed files with 33 additions and 6 deletions

View File

@@ -26,6 +26,13 @@ export function createSettingsUpdateHandler() {
const { maxSessions } = req.body;
if (typeof maxSessions === "number") {
if (!Number.isInteger(maxSessions)) {
res.status(400).json({
success: false,
error: "maxSessions must be an integer",
});
return;
}
if (maxSessions < MIN_MAX_SESSIONS || maxSessions > MAX_MAX_SESSIONS) {
res.status(400).json({
success: false,