feat: CSRF защита (double-submit cookie) — все мутирующие POST-роуты, login-форма

This commit is contained in:
2026-05-30 13:28:01 +03:00
parent 2332827326
commit 695ed231e6
6 changed files with 75 additions and 10 deletions
+9
View File
@@ -9,6 +9,7 @@
"version": "0.1.0",
"dependencies": {
"cookie-parser": "^1.4.7",
"csrf-csrf": "^4.0.3",
"dotenv": "^16.4.7",
"ejs": "^3.1.10",
"express": "^4.21.1",
@@ -165,6 +166,14 @@
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz",
"integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA=="
},
"node_modules/csrf-csrf": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/csrf-csrf/-/csrf-csrf-4.0.3.tgz",
"integrity": "sha512-DaygOzelL4Qo1pHwI9LPyZL+X2456/OzpT596kNeZGiTSqKVDOk/9PPJ+FjzZacjMUEusOHw3WJKe1RW4iUhrw==",
"dependencies": {
"http-errors": "^2.0.0"
}
},
"node_modules/debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",