From 5b17df17a1dd4ef2254ba0d9dacb34c653cd6572 Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Sat, 28 Sep 2024 15:47:47 +0200 Subject: [PATCH] store time when last totp was used --- totp.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/totp.php b/totp.php index 37a8462bc..94106c0d7 100644 --- a/totp.php +++ b/totp.php @@ -89,6 +89,11 @@ } else { $invalidTotp = true; } + } else { + $statement = $db->prepare('UPDATE totp SET last_totp_used = :last_totp_used WHERE user_id = :id'); + $statement->bindValue(':last_totp_used', time(), SQLITE3_INTEGER); + $statement->bindValue(':id', $_SESSION['totp_user_id'], SQLITE3_INTEGER); + $statement->execute(); } if ($valid) {