mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
feat: Validate password hash
Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
parent
dba00560d2
commit
c390ae94ff
1 changed files with 4 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ declare(strict_types=1);
|
|||
*/
|
||||
namespace OC\User;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use OCP\AppFramework\Db\TTransactional;
|
||||
use OCP\Cache\CappedMemoryCache;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
|
|
@ -200,6 +201,9 @@ class Database extends ABackend implements
|
|||
}
|
||||
|
||||
public function setPasswordHash(string $userId, string $passwordHash): bool {
|
||||
if (!\OCP\Server::get(IHasher::class)->validate($passwordHash)) {
|
||||
throw new InvalidArgumentException();
|
||||
}
|
||||
$this->fixDI();
|
||||
$result = $this->updatePassword($userId, $passwordHash);
|
||||
if (!$result) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue