| … | … | @@ -268,7 +268,7 @@ function sendError(res, message, status = 500) { |
| 268 | 268 | * @returns {function} - Wrapped handler with auth check |
| 269 | 269 | */ |
| 270 | 270 | function requireAuth(handler) { |
| 271 | | return async (req, res, param) => { |
| 271 | return async (req, res, ...params) => { |
| 272 | 272 | // Verify Bearer token |
| 273 | 273 | if (!verifyToken(req)) { |
| 274 | 274 | console.warn(`⚠️ Unauthorized access attempt: ${req.method} ${req.url}`) |
| … | … | @@ -276,7 +276,7 @@ function requireAuth(handler) { |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | // Token valid - proceed to handler |
| 279 | | return handler(req, res, param) |
| 279 | return handler(req, res, ...params) |
| 280 | 280 | } |
| 281 | 281 | } |
| 282 | 282 | |
| … | … | @@ -288,7 +288,7 @@ function requireAuth(handler) { |
| 288 | 288 | * @returns {function} - Wrapped handler with rate limit check |
| 289 | 289 | */ |
| 290 | 290 | function withRateLimit(handler) { |
| 291 | | return async (req, res, param) => { |
| 291 | return async (req, res, ...params) => { |
| 292 | 292 | const result = checkRateLimit(req) |
| 293 | 293 | |
| 294 | 294 | // Set rate limit headers |
| … | … | @@ -302,7 +302,7 @@ function withRateLimit(handler) { |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | // Rate limit OK - proceed to handler |
| 305 | | return handler(req, res, param) |
| 305 | return handler(req, res, ...params) |
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | |