mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
parent
b6d73df92e
commit
62f8f8f1a7
@ -29,7 +29,7 @@ keyPath=
|
||||
trustedReverseProxy=false
|
||||
|
||||
|
||||
[Cookies]
|
||||
[Session]
|
||||
# Use this setting to constrain the current instance's "Path" value for the set cookies
|
||||
# This can be useful, when you have several instances running on the same domain, under different paths (e.g. by using a reverse proxy).
|
||||
# It prevents your instances from overwriting each others' cookies.
|
||||
|
@ -6,7 +6,7 @@ import config from "../services/config.js";
|
||||
const doubleCsrfUtilities = doubleCsrf({
|
||||
getSecret: () => sessionSecret,
|
||||
cookieOptions: {
|
||||
path: config.Cookies.cookiePath,
|
||||
path: config.Session.cookiePath,
|
||||
secure: false,
|
||||
sameSite: "strict",
|
||||
httpOnly: !isElectron // set to false for Electron, see https://github.com/TriliumNext/Notes/pull/966
|
||||
|
@ -10,7 +10,7 @@ const sessionParser = session({
|
||||
resave: false, // true forces the session to be saved back to the session store, even if the session was never modified during the request.
|
||||
saveUninitialized: false, // true forces a session that is "uninitialized" to be saved to the store. A session is uninitialized when it is new but not modified.
|
||||
cookie: {
|
||||
path: config.Cookies.cookiePath,
|
||||
path: config.Session.cookiePath,
|
||||
httpOnly: true,
|
||||
maxAge: 24 * 60 * 60 * 1000 // in milliseconds
|
||||
},
|
||||
|
@ -32,7 +32,7 @@ export interface TriliumConfig {
|
||||
keyPath: string;
|
||||
trustedReverseProxy: boolean | string;
|
||||
};
|
||||
Cookies: {
|
||||
Session: {
|
||||
cookiePath: string;
|
||||
}
|
||||
Sync: {
|
||||
@ -79,9 +79,9 @@ const config: TriliumConfig = {
|
||||
process.env.TRILIUM_NETWORK_TRUSTEDREVERSEPROXY || iniConfig.Network.trustedReverseProxy || false
|
||||
},
|
||||
|
||||
Cookies: {
|
||||
Session: {
|
||||
cookiePath:
|
||||
process.env.TRILIUM_COOKIES_COOKIEPATH || iniConfig?.Cookies?.cookiePath || "/"
|
||||
process.env.TRILIUM_SESSION_COOKIEPATH || iniConfig?.Session?.cookiePath || "/"
|
||||
},
|
||||
|
||||
Sync: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user