fix: move call for formSecurityCheck to before express validator array in contactRoutes.js

This commit is contained in:
2025-08-20 08:32:35 -05:00
parent 5116cdc445
commit 9f47800032
2 changed files with 145 additions and 3 deletions

View File

@@ -18,6 +18,7 @@ module.exports = (contactController) => {
// Define the route for form submissions
router.post('/submit-form',
apiLimiter,
formSecurityCheck
[
// express-validator: sanitation and validation
body('firstName').trim().escape(),
@@ -37,7 +38,7 @@ module.exports = (contactController) => {
next();
},
// The security middleware
formSecurityCheck,
// formSecurityCheck,
// The controller, which is the final step
contactController.submitForm
);