From a33691d64242620c1f74fe85f4e9a58eeeec45c1 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 12 Apr 2020 20:36:18 -0400 Subject: [PATCH] fix: bypass users model when updating lastLoginAt --- server/models/users.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/models/users.js b/server/models/users.js index 4742cffa..27e28d57 100644 --- a/server/models/users.js +++ b/server/models/users.js @@ -342,7 +342,8 @@ module.exports = class User extends Model { } // Update Last Login Date - await WIKI.models.users.query().findById(user.id).patch({ lastLoginAt: new Date().toISOString() }) + // -> Bypass Objection.js to avoid updating the updatedAt field + await WIKI.models.knex('users').where('id', user.id).update({ lastLoginAt: new Date().toISOString() }) return { token: jwt.sign({