fix: objection.js 2.0 compat fixes
This commit is contained in:
@@ -56,7 +56,7 @@ module.exports = class UserKey extends Model {
|
||||
}
|
||||
|
||||
static async validateToken ({ kind, token }, context) {
|
||||
const res = await WIKI.models.userKeys.query().findOne({ kind, token }).eager('user')
|
||||
const res = await WIKI.models.userKeys.query().findOne({ kind, token }).withGraphJoined('user')
|
||||
if (res) {
|
||||
await WIKI.models.userKeys.query().deleteById(res.id)
|
||||
if (moment.utc().isAfter(moment.utc(res.validUntil))) {
|
||||
|
Reference in New Issue
Block a user