Added exemple debug user on NS_NOUSER env variable

This commit is contained in:
mrfry 2020-08-30 09:54:00 +02:00
parent 765ca2556e
commit 9ff253bb1a

View file

@ -26,6 +26,18 @@ module.exports = function (options) {
return req.url.split('?')[0] === exc
})
if (process.env.NS_NOUSER) {
req.session = {
user: {
id: 21323
},
sessionID: sessionID || 111111111111111111,
isException: false
}
next()
return
}
// FIXME Allowing all urls with _next in it, but not in params
if (req.url.split('?')[0].includes('_next')) {
req.session = { isException: true }