diff --git a/security/custom_password_authenticator.rst b/security/custom_password_authenticator.rst index 37ba27c03f8..0fadd5d9c8a 100644 --- a/security/custom_password_authenticator.rst +++ b/security/custom_password_authenticator.rst @@ -63,7 +63,7 @@ the user:: if ('' === ($givenPassword = $token->getCredentials())) { throw new BadCredentialsException('The given password cannot be empty.'); } - if (!$this->encoderFactory->getEncoder($user)->isPasswordValid($user->getPassword(), $givenPassword, $user->getSalt())) { + if (!$this->encoder->isPasswordValid($user->getPassword(), $givenPassword, $user->getSalt())) { throw new BadCredentialsException('The given password is invalid.'); } }