mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 22:34:56 +00:00
code: set,nextjs,frontends (2 files)
This commit is contained in:
@@ -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,
|
||||
}))
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user