feat: user profile page - save info + change pwd
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
const Model = require('objection').Model
|
||||
const moment = require('moment')
|
||||
const nanoid = require('nanoid')
|
||||
const nanoid = require('nanoid').nanoid
|
||||
|
||||
/**
|
||||
* Users model
|
||||
|
@@ -341,6 +341,9 @@ module.exports = class User extends Model {
|
||||
user.groups = await user.$relatedQuery('groups').select('groups.id', 'permissions')
|
||||
}
|
||||
|
||||
// Update Last Login Date
|
||||
await WIKI.models.users.query().findById(user.id).patch({ lastLoginAt: new Date().toISOString() })
|
||||
|
||||
return {
|
||||
token: jwt.sign({
|
||||
id: user.id,
|
||||
|
Reference in New Issue
Block a user