Update password handling and session methods
This commit is contained in:
parent
8b9896f196
commit
85814913e4
11 changed files with 239 additions and 70 deletions
|
@ -115,6 +115,32 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the stored password for a specific peer.
|
||||
*
|
||||
* @param string|RegisteredPeerRecord $peerUuid The unique identifier of the peer, or an instance of RegisteredPeerRecord.
|
||||
* @return void
|
||||
* @throws DatabaseOperationException If an error occurs during the database operation.
|
||||
*/
|
||||
public static function deletePassword(string|RegisteredPeerRecord $peerUuid): void
|
||||
{
|
||||
if($peerUuid instanceof RegisteredPeerRecord)
|
||||
{
|
||||
$peerUuid = $peerUuid->getUuid();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$stmt = Database::getConnection()->prepare('DELETE FROM authentication_passwords WHERE peer_uuid=:uuid');
|
||||
$stmt->bindParam(':uuid', $peerUuid);
|
||||
$stmt->execute();
|
||||
}
|
||||
catch(PDOException $e)
|
||||
{
|
||||
throw new DatabaseOperationException('An error occurred while deleting the password', $e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies a given password against a stored password hash for a specific peer.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue