#274 save last login date
This commit is contained in:
parent
0f5865e4dd
commit
70e4b9e214
|
@ -0,0 +1,6 @@
|
||||||
|
-- Up
|
||||||
|
|
||||||
|
ALTER TABLE users ADD COLUMN lastActive INTEGER NULL;
|
||||||
|
|
||||||
|
-- Down
|
||||||
|
|
|
@ -176,6 +176,9 @@ const reloadUser = async (req, res, next) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('reloadUser');
|
||||||
|
await req.db.get(SQL`UPDATE users SET lastActive = ${+new Date} WHERE id = ${req.user.id}`);
|
||||||
|
|
||||||
if (req.user.username !== dbUser.username
|
if (req.user.username !== dbUser.username
|
||||||
|| req.user.email !== dbUser.email
|
|| req.user.email !== dbUser.email
|
||||||
|| req.user.roles !== dbUser.roles
|
|| req.user.roles !== dbUser.roles
|
||||||
|
|
Reference in New Issue