From e273b81925ffb120c86fea2f952bb2a31fe66b07 Mon Sep 17 00:00:00 2001 From: tracer Date: Sun, 13 Jun 2021 16:20:07 +0200 Subject: [PATCH] removed encoder, set hasher --- src/Repository/UserRepository.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Repository/UserRepository.php b/src/Repository/UserRepository.php index 1a38975..11fe76a 100644 --- a/src/Repository/UserRepository.php +++ b/src/Repository/UserRepository.php @@ -8,6 +8,7 @@ use Doctrine\Persistence\ManagerRegistry; use Symfony\Component\Security\Core\Exception\UnsupportedUserException; use Symfony\Component\Security\Core\User\PasswordUpgraderInterface; use Symfony\Component\Security\Core\User\UserInterface; +use function get_class; /** * @method User|null find($id, $lockMode = null, $lockVersion = null) @@ -25,13 +26,13 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader /** * Used to upgrade (rehash) the user's password automatically over time. */ - public function upgradePassword(UserInterface $user, string $newEncodedPassword): void + public function upgradePassword(UserInterface $user, string $newHashedPassword): void { if (!$user instanceof User) { - throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', \get_class($user))); + throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', get_class($user))); } - $user->setPassword($newEncodedPassword); + $user->setPassword($newHashedPassword); $this->_em->persist($user); $this->_em->flush(); }