Remove unused updateOtp method from OneTimePasswordManager.
This commit is contained in:
parent
866bb90f2a
commit
d99ded7281
1 changed files with 0 additions and 28 deletions
|
@ -202,32 +202,4 @@
|
||||||
|
|
||||||
return $updated->getTimestamp();
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue