update timestamp when user logs in (#15489)

* update timestamp when user logs in

* fix(comment): typo

---------

Co-authored-by: Kalista Payne <sabrecat@gmail.com>
This commit is contained in:
Phillip Thelen
2025-08-19 21:04:33 +02:00
committed by GitHub
parent 3a2f5e724d
commit 836cbdb81e
4 changed files with 37 additions and 4 deletions

View File

@@ -121,8 +121,10 @@ api.loginLocal = {
// convert the hashed password to bcrypt from sha1
if (user.auth.local.passwordHashMethod === 'sha1') {
await passwordUtils.convertToBcrypt(user, password);
await user.save();
}
// Force the updated timestamp to update, so that we know they logged in
user.auth.timestamps.updated = new Date();
await user.save();
res.analytics.track('login', {
category: 'behaviour',