Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
req.session.deviceId = req.params.deviceId
telemetryHelper.logSessionStart(req)
req.session.logSession = true
}
res.status(200)
res.end()
})
app.use('/resourcebundles/v1', bodyParser.urlencoded({ extended: false }),
bodyParser.json({ limit: '50mb' }), require('./helpers/resourceBundles')(express)) // Resource bundles apis
const subApp = express()
subApp.use(bodyParser.json({ limit: '50mb' }))
app.use('/plugin', subApp)
frameworkAPI.bootstrap(frameworkConfig, subApp).then(data => runApp()).catch(error => runApp())
function endSession(request, response, next) {
delete request.session['roles']
delete request.session['rootOrgId']
delete request.session['orgs']
if (request.session) {
if (_.get(request, 'session.userId')) { telemetryHelper.logSessionEnd(request) }
delete request.session.sessionEvents
delete request.session['deviceId']
}
next()
}
if (!process.env.sunbird_environment || !process.env.sunbird_instance) {
console.error('please set environment variable sunbird_environment, ' +
'sunbird_instance start service Eg: sunbird_environment = dev, sunbird_instance = sunbird')