first commit

This commit is contained in:
2026-08-08 00:15:48 +03:00
parent ac2bc13da0
commit d98b4c1343
146 changed files with 122827 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;