admin_to_react

This commit is contained in:
2026-08-09 14:13:06 +03:00
commit 5d2fc5773c
163 changed files with 140326 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
// middleware/csrf.js
const csurf = require('csurf');
const csrfProtection = csurf({ cookie: false });
const csrfMiddleware = (req, res, next) => {
if (
req.path === '/login' ||
req.path === '/moders/moder-login' ||
req.path === '/moders/csrf-token'
) {
return next();
}
return csrfProtection(req, res, next);
};
module.exports = csrfMiddleware;