Skip to content

Commit

Permalink
chore: adding one more validation to the get endpoint (#1212)
Browse files Browse the repository at this point in the history
  • Loading branch information
zenit2001 authored Nov 14, 2024
1 parent 9296108 commit ef0f59f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
const server = require('server');
const Transaction = require('dw/system/Transaction');
const csrfProtection = require('*/cartridge/scripts/middleware/csrf');
const csrfProtection = require('dw/web/CSRFProtection');
const URLUtils = require('dw/web/URLUtils');
const AdyenConfigs = require('*/cartridge/adyen/utils/adyenConfigs');
const AdyenHelper = require('*/cartridge/adyen/utils/adyenHelper');
const constants = require('*/cartridge/adyen/config/constants');
const AdyenLogs = require('*/cartridge/adyen/logs/adyenCustomLogs');

server.get('Start', csrfProtection.generateToken, (_req, res, next) => {
server.get('Start', (_req, res, next) => {
if (!csrfProtection.validateRequest()) {
res.redirect(URLUtils.url('CSRF-Fail'));
return next();
}
res.render('adyenSettings/settings');
return next();
});
Expand Down

0 comments on commit ef0f59f

Please sign in to comment.