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

@@ -110,6 +110,18 @@ describe('POST /user/auth/local/login', () => {
expect(isValidPassword).to.equal(true);
});
it('sets auth.timestamps.updated', async () => {
const oldUpdated = new Date(user.auth.timestamps.updated);
// login
await api.post(endpoint, {
username: user.auth.local.email,
password,
});
await user.sync();
expect(user.auth.timestamps.updated).to.be.greaterThan(oldUpdated);
});
it('user uses social authentication and has no password', async () => {
await user.unset({
'auth.local.hashed_password': 1,