Skip to content

Commit

Permalink
store time when last totp was used
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Ribeiro committed Sep 28, 2024
1 parent c38ba8d commit 5b17df1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5b17df1

Please sign in to comment.