From d99ded728109d47a296b2404d05209d60fe4657c Mon Sep 17 00:00:00 2001 From: netkas Date: Tue, 7 Jan 2025 14:15:28 -0500 Subject: [PATCH] Remove unused updateOtp method from OneTimePasswordManager. --- .../Managers/OneTimePasswordManager.php | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/src/Socialbox/Managers/OneTimePasswordManager.php b/src/Socialbox/Managers/OneTimePasswordManager.php index cb437bb..18c4e26 100644 --- a/src/Socialbox/Managers/OneTimePasswordManager.php +++ b/src/Socialbox/Managers/OneTimePasswordManager.php @@ -202,32 +202,4 @@ return $updated->getTimestamp(); } - - /** - * Updates the last updated timestamp for the OTP record of the specified peer. - * - * @param string|RegisteredPeerRecord $peerUuid The peer's UUID or an instance of RegisteredPeerRecord whose OTP record needs to be updated. - * @return void - * @throws DatabaseOperationException if the database operation fails. - */ - public static function updateOtp(string|RegisteredPeerRecord $peerUuid): void - { - if($peerUuid instanceof RegisteredPeerRecord) - { - $peerUuid = $peerUuid->getUuid(); - } - - try - { - $stmt = Database::getConnection()->prepare('UPDATE authentication_otp SET updated=:updated WHERE peer_uuid=:uuid'); - $updated = (new DateTime())->setTimestamp(time()); - $stmt->bindParam(':updated', $updated); - $stmt->bindParam(':uuid', $peerUuid); - $stmt->execute(); - } - catch(PDOException $e) - { - throw new DatabaseOperationException(sprintf('Failed to update the OTP secret for user %s', $peerUuid), $e); - } - } } \ No newline at end of file