소스 검색

fix: bypass users model when updating lastLoginAt

NGPixel 5 년 전
부모
커밋
a33691d642
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      server/models/users.js

+ 2 - 1
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({