mirror of https://github.com/TriliumNext/Notes
Merge pull request #960 from pano9000/fix_csrf-csrf_existing_cookie
fix(csrf): fix handling of existing _csrf cookiesrelease/v0.91.3-beta
parent
5ca876ca62
commit
62cda1bd24
@ -0,0 +1,15 @@
|
|||||||
|
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 { generateToken, doubleCsrfProtection } = doubleCsrfUtilities;
|
||||||
Loading…
Reference in New Issue