[Security] Check UserInterface::getPassword is not null before calling needsRehash
This commit is contained in:
parent
70dec3c8a3
commit
8e4cf497cd
@ -56,6 +56,10 @@ class UserPasswordEncoder implements UserPasswordEncoderInterface
|
||||
*/
|
||||
public function needsRehash(UserInterface $user): bool
|
||||
{
|
||||
if (null === $user->getPassword()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$encoder = $this->encoderFactory->getEncoder($user);
|
||||
|
||||
return method_exists($encoder, 'needsRehash') && $encoder->needsRehash($user->getPassword());
|
||||
|
Reference in New Issue
Block a user