1
0
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:
Christopher Kolstad 2021-05-05 14:56:09 +02:00
parent 447e44ee77
commit 40a358ac78

View File

@ -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,