// extends config sessionparams with mongo store // does not throw exception if no mongo instance is available async function addMongoStore (config) { try { if (await testForMongoDB(config)) { const Session = connectMongo(expressSession) config.sessionParams.store = new Session(config.mongoStore) config.sessionParams.secret = getSecret() } } catch (err) { console.warn(`${logo} mongodb not configured, but that's ok`) } }