|
|
@ -167,13 +167,19 @@ module.exports = function(app, data) {
|
|
|
|
app.use(bodyParser.json());
|
|
|
|
app.use(bodyParser.json());
|
|
|
|
app.use(cookieParser());
|
|
|
|
app.use(cookieParser());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var cookie = {
|
|
|
|
|
|
|
|
maxAge: 1000 * 60 * 60 * 24 * parseInt(meta.configs.loginDays || 14, 10)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
var cookieDomain = nconf.get('cookie-domain');
|
|
|
|
|
|
|
|
if(cookieDomain) {
|
|
|
|
|
|
|
|
cookie.domain = cookieDomain;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
app.use(session({
|
|
|
|
app.use(session({
|
|
|
|
store: db.sessionStore,
|
|
|
|
store: db.sessionStore,
|
|
|
|
secret: nconf.get('secret'),
|
|
|
|
secret: nconf.get('secret'),
|
|
|
|
key: 'express.sid',
|
|
|
|
key: 'express.sid',
|
|
|
|
cookie: {
|
|
|
|
cookie: cookie,
|
|
|
|
maxAge: 1000 * 60 * 60 * 24 * parseInt(meta.configs.loginDays || 14, 10)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
resave: true,
|
|
|
|
resave: true,
|
|
|
|
saveUninitialized: true
|
|
|
|
saveUninitialized: true
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|