server: fix sessions store not being in koa-session middleware

This commit is contained in:
Katalina / stardust 2017-12-27 00:51:14 -06:00
parent 6ec6123fa9
commit e36be9e381
3 changed files with 14 additions and 15 deletions

View file

@ -29,9 +29,12 @@ class SessionsService extends Service {
}
async destroy (id) {
return (await this.Session.findOne({ where: { id } })).destroy()
}
const sess = await this.Session.findOne({ where: { id } })
if (sess != null) {
return sess.destroy()
}
}
}
module.exports = SessionsService