diff --git a/src/bp/core/server.ts b/src/bp/core/server.ts index 01cdd123475..63fb459e45f 100644 --- a/src/bp/core/server.ts +++ b/src/bp/core/server.ts @@ -142,7 +142,7 @@ export default class HTTPServer { this.app.use(monitoringMiddleware) - if (config.session.enabled) { + if (config.session && config.session.enabled) { this.app.use( session({ secret: process.APP_SECRET, diff --git a/src/bp/vanilla/botpress.config.schema.json b/src/bp/vanilla/botpress.config.schema.json index f4f93ed99b1..f3a256e907a 100644 --- a/src/bp/vanilla/botpress.config.schema.json +++ b/src/bp/vanilla/botpress.config.schema.json @@ -29,6 +29,17 @@ "type": "string" } } + }, + "session": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "maxAge": { + "type": "string" + } + } } }, "required": ["backlog", "bodyLimit", "cors", "host", "port"]