mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 10:15:52 +01:00
16 lines
440 B
TypeScript
16 lines
440 B
TypeScript
|
|
import { doubleCsrf } from "csrf-csrf";
|
||
|
|
import sessionSecret from "../services/session_secret.js";
|
||
|
|
|
||
|
|
const doubleCsrfUtilities = doubleCsrf({
|
||
|
|
getSecret: () => sessionSecret,
|
||
|
|
cookieOptions: {
|
||
|
|
path: "", // empty, so cookie is valid only for the current path
|
||
|
|
secure: false,
|
||
|
|
sameSite: false,
|
||
|
|
httpOnly: false
|
||
|
|
},
|
||
|
|
cookieName: "_csrf"
|
||
|
|
});
|
||
|
|
|
||
|
|
export const { doubleCsrfProtection } = doubleCsrfUtilities;
|