mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 20:03:37 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user