code: set,nextjs,frontends (2 files)

This commit is contained in:
2025-12-26 00:23:04 +00:00
parent 6bdcbcf034
commit 369d44e1eb
2 changed files with 5 additions and 1 deletions

View File

@@ -55,6 +55,7 @@ describe('setCredential', () => {
// Should always update user's password change timestamp
expect(mockUpdate).toHaveBeenCalledWith('User', existingUser[0].id, expect.objectContaining({
passwordChangeTimestamp: expect.any(BigInt),
firstLogin: false,
}))
})
})

View File

@@ -22,6 +22,9 @@ export async function setCredential(username: string, passwordHash: string): Pro
const users = await adapter.list('User', { filter: { username } })
if (users.data.length > 0) {
const user = users.data[0] as any
await adapter.update('User', user.id, { passwordChangeTimestamp: BigInt(Date.now()) })
await adapter.update('User', user.id, {
passwordChangeTimestamp: BigInt(Date.now()),
firstLogin: false,
})
}
}