| 402 | }); | 402 | }); |
| 403 | }); | 403 | }); |
| 404 | | 404 | |
| | 405 | // Customize the error message |
| | 406 | csrfSyncProtection.invalidCsrfTokenError.message = color.red('Invalid CSRF token. Please refresh the page and try again.'); |
| | 407 | csrfSyncProtection.invalidCsrfTokenError.stack = undefined; |
| | 408 | |
| 405 | app.use(csrfSyncProtection.csrfSynchronisedProtection); | 409 | app.use(csrfSyncProtection.csrfSynchronisedProtection); |
| 406 | } else { | 410 | } else { |
| 407 | console.warn('\nCSRF protection is disabled. This will make your server vulnerable to CSRF attacks.\n'); | 411 | console.warn('\nCSRF protection is disabled. This will make your server vulnerable to CSRF attacks.\n'); |