mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
Merge pull request #966 from pano9000/fix_csrf-electron-httpOnly
fix(csrf): add exception for electron for httpOnly cookie
This commit is contained in:
commit
467852191d
@ -1,5 +1,6 @@
|
||||
import { doubleCsrf } from "csrf-csrf";
|
||||
import sessionSecret from "../services/session_secret.js";
|
||||
import { isElectron } from "../services/utils.js";
|
||||
|
||||
const doubleCsrfUtilities = doubleCsrf({
|
||||
getSecret: () => sessionSecret,
|
||||
@ -7,7 +8,7 @@ const doubleCsrfUtilities = doubleCsrf({
|
||||
path: "", // empty, so cookie is valid only for the current path
|
||||
secure: false,
|
||||
sameSite: "strict",
|
||||
httpOnly: true
|
||||
httpOnly: !isElectron() // set to false for Electron, see https://github.com/TriliumNext/Notes/pull/966
|
||||
},
|
||||
cookieName: "_csrf"
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user