SessionSQL does not properly handle an empty response
Currently, it throws an error on an empty response which can be caught and worked around by the user. However, the library should smooth this result into a blank object instead.
Here is the workaround
app.use((req, res) => {
return Session.getMiddleware({
secret: cfg.main.cookieSecret || 'foo',
store: new Session.SessionStoreSQL({
db: app.database.getEngine('mysql'),
model: Session.SessionStoreModel
})
})(req, res).catch(() => {})
})
By abstracting the middleware and calling it with (req, res).catch(() => {})
I can catch the error and move on safely.