Browse Source

fix: bypass users model when updating lastLoginAt

pull/1457/head
NGPixel 5 years ago
committed by Nicolas Giard
parent
commit
a33691d642
1 changed files with 2 additions and 1 deletions
  1. 3
      server/models/users.js

3
server/models/users.js

@ -342,7 +342,8 @@ module.exports = class User extends Model {
} }
// Update Last Login Date // 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 { return {
token: jwt.sign({ token: jwt.sign({

Loading…
Cancel
Save