mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-11 11:02:27 +08: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;
|