feat: update the customer's last_used_machine on auth attempt

This commit is contained in:
siiky 2024-07-18 16:47:59 +01:00
parent bb303a38cf
commit 53830aba52
2 changed files with 8 additions and 7 deletions

View file

@ -930,9 +930,9 @@ function disableTestCustomer (customerId) {
return db.none(sql, [customerId])
}
function updateLastAuthAttempt (customerId) {
const sql = `UPDATE customers SET last_auth_attempt=NOW() WHERE id=$1`
return db.none(sql, [customerId])
function updateLastAuthAttempt (customerId, deviceId) {
const sql = `UPDATE customers SET last_auth_attempt=NOW(), last_used_machine=$2 WHERE id=$1`
return db.none(sql, [customerId, deviceId])
}
function getExternalComplianceMachine (customer) {