mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
fix: an hour is 3600000 seconds not 60000 seconds
This commit is contained in:
parent
447e44ee77
commit
40a358ac78
@ -5,13 +5,14 @@ const session = require('express-session');
|
||||
const KnexSessionStore = require('connect-session-knex')(session);
|
||||
|
||||
const TWO_DAYS = 48 * 60 * 60 * 1000;
|
||||
const HOUR = 60 * 60 * 1000;
|
||||
function sessionDb(
|
||||
config: Pick<IUnleashConfig, 'session' | 'server' | 'secureHeaders'>,
|
||||
stores: Pick<IUnleashStores, 'db'>,
|
||||
): any {
|
||||
let store;
|
||||
const { db } = config.session;
|
||||
const age = config.session.ttlHours * 60000 || TWO_DAYS;
|
||||
const age = config.session.ttlHours * HOUR || TWO_DAYS;
|
||||
if (db) {
|
||||
store = new KnexSessionStore({
|
||||
knex: stores.db,
|
||||
|
Loading…
Reference in New Issue
Block a user