mirror of
https://github.com/zadam/trilium.git
synced 2024-12-26 17:21:23 +08:00
filestore for sessions
This commit is contained in:
parent
f2d2dad3d8
commit
597a9063e5
3 changed files with 8 additions and 2 deletions
|
@ -6,6 +6,7 @@ const cookieParser = require('cookie-parser');
|
|||
const bodyParser = require('body-parser');
|
||||
const helmet = require('helmet');
|
||||
const session = require('express-session');
|
||||
const FileStore = require('session-file-store')(session);
|
||||
|
||||
const appRoute = require('./routes/app');
|
||||
const loginRoute = require('./routes/login');
|
||||
|
@ -48,7 +49,11 @@ app.use(session({
|
|||
// path: "/",
|
||||
httpOnly: true,
|
||||
maxAge: 1800000
|
||||
}
|
||||
},
|
||||
store: new FileStore({
|
||||
ttl: 3600,
|
||||
path: '../sessions'
|
||||
})
|
||||
}));
|
||||
// uncomment after placing your favicon in /public
|
||||
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"morgan": "~1.9.0",
|
||||
"scrypt": "^6.0.3",
|
||||
"serve-favicon": "~2.4.5",
|
||||
"session-file-store": "^1.1.2",
|
||||
"sqlite": "^2.8.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ function randomString(length, chars) {
|
|||
}
|
||||
|
||||
function nowTimestamp() {
|
||||
return Date.now() / 1000;
|
||||
return Math.floor(Date.now() / 1000);
|
||||
}
|
||||
|
||||
function toBase64(plainText) {
|
||||
|
|
Loading…
Reference in a new issue