Skip to content

Commit

Permalink
fix:PasswordEncoderからPasswordHasherへ修正
Browse files Browse the repository at this point in the history
  • Loading branch information
dotani1111 committed Feb 26, 2024
1 parent 5b3e12c commit 7e4f4ca
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions EventListener/UserResolveListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Plugin\Api42\EventListener;

use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use League\Bundle\OAuth2ServerBundle\Event\UserResolveEvent;

Expand All @@ -25,18 +25,18 @@ final class UserResolveListener
private $userProvider;

/**
* @var UserPasswordEncoderInterface
* @var UserPasswordHasherInterface
*/
private $userPasswordEncoder;
private $userPasswordHasher;

/**
* @param UserProviderInterface $userProvider
* @param UserPasswordEncoderInterface $userPasswordEncoder
* @param UserPasswordHasherInterface $userPasswordHasher
*/
public function __construct(UserProviderInterface $userProvider, UserPasswordEncoderInterface $userPasswordEncoder)
public function __construct(UserProviderInterface $userProvider, UserPasswordHasherInterface $userPasswordHasher)
{
$this->userProvider = $userProvider;
$this->userPasswordEncoder = $userPasswordEncoder;
$this->userPasswordHasher = $userPasswordHasher;
}

/**
Expand All @@ -50,7 +50,7 @@ public function onUserResolve(UserResolveEvent $event): void
return;
}

if (!$this->userPasswordEncoder->isPasswordValid($user, $event->getPassword())) {
if (!$this->userPasswordHasher->isPasswordValid($user, $event->getPassword())) {
return;
}

Expand Down

0 comments on commit 7e4f4ca

Please sign in to comment.