Skip to content

Build your personal knowledge base with Trilium Notes

Merge remote-tracking branch 'origin/main' into renovate/csrf-csrf-4.x

Elian Dorana3a3b3cb5c65
diff --cc apps/server/package.json
index f52fc5d318,c00114e0ee..6a2249c014
--- a/apps/server/package.json
+++ b/apps/server/package.json
@@@ -46,15 -46,15 +46,15 @@@
"@triliumnext/turndown-plugin-gfm": "workspace:*",
"archiver": "7.0.1",
"async-mutex": "0.5.0",
- "axios": "1.9.0",
+ "axios": "1.11.0",
"bindings": "1.5.0",
"chardet": "2.1.0",
- "cheerio": "1.1.0",
+ "cheerio": "1.1.2",
"chokidar": "4.0.3",
"cls-hooked": "4.2.2",
- "compression": "1.8.0",
+ "compression": "1.8.1",
"cookie-parser": "1.4.7",
- "csrf-csrf": "3.2.2",
+ "csrf-csrf": "4.0.2",
"dayjs": "1.11.13",
"debounce": "2.2.0",
"debug": "4.4.1",
diff --cc apps/server/src/routes/csrf_protection.ts
index 2b26afbf3e,0b0ba1aac8..b7c5f8d5cb
--- a/apps/server/src/routes/csrf_protection.ts
+++ b/apps/server/src/routes/csrf_protection.ts
@@@ -10,10 -8,9 +10,10 @@@ const doubleCsrfUtilities = doubleCsrf(
path: "/",
secure: false,
sameSite: "strict",
- httpOnly: !isElectron // set to false for Electron, see https://github.com/TriliumNext/Notes/pull/966
+ httpOnly: !isElectron // set to false for Electron, see https://github.com/TriliumNext/Trilium/pull/966
},
- cookieName: "_csrf"
+ cookieName: CSRF_COOKIE_NAME,
+ getSessionIdentifier: (req) => req.session.id
});
-export const { generateToken, doubleCsrfProtection } = doubleCsrfUtilities;
+export const { generateCsrfToken, doubleCsrfProtection } = doubleCsrfUtilities;