Fix jwt-token
This commit is contained in:
@@ -53,8 +53,12 @@ router.get('/', authenticateToken, async (req, res) => {
|
|||||||
} = req.query;
|
} = req.query;
|
||||||
|
|
||||||
// Validate and sanitize pagination parameters
|
// Validate and sanitize pagination parameters
|
||||||
const validatedPage = Math.max(1, parseInt(page) || 1);
|
const parsedPage = parseInt(page);
|
||||||
const validatedLimit = Math.min(100, Math.max(1, parseInt(limit) || 50));
|
const parsedLimit = parseInt(limit);
|
||||||
|
|
||||||
|
// Use defaults for invalid values
|
||||||
|
const validatedPage = (parsedPage > 0) ? parsedPage : 1;
|
||||||
|
const validatedLimit = (parsedLimit > 0 && parsedLimit <= 100) ? parsedLimit : 50;
|
||||||
|
|
||||||
// Build where clause for filtering
|
// Build where clause for filtering
|
||||||
const whereClause = {};
|
const whereClause = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user