-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
fix src/AppBundle/Security/TimeAuthenticator.php #10146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
$isPasswordValid was emty isPasswordValid attempted UserInterface first argument, string given
Shouldn't we remove the |
I think $isPasswordValid was undefined |
That's right. But what I mean is that even if we initialise the variable now, it will never be |
throw new BadCredentialsException('The credentials were changed from another session.'); | ||
} | ||
} else { | ||
if ('' === ($givenPassword = $token->getCredentials())) { | ||
throw new BadCredentialsException('The given password cannot be empty.'); | ||
} | ||
if (!$this->encoder->isPasswordValid($user->getPassword(), $givenPassword, $user->getSalt())) { | ||
if (!$isPasswordValid=$this->encoder->isPasswordValid($user, $givenPassword, $user->getSalt())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong, should be:
if ($isPasswordValid = !$this->encoder->isPasswordValid($user, $givenPassword, $user->getSalt())) {
(look at the position of !
)
I agree with @xabbuh, we should just remove the It seems that it was overlooked when making this change: https://github.com/Reyh/symfony-docs/commit/3fb163c0792f695e85bbdbe1dbdc138db58f8e5e#diff-0afb1ed1142b93956c79786c3b4c6550 |
@Reyh thanks a lot for this contribution and for helping us improve the current code. Sadly this pull request "stalled" and there are merge conflicts, so I've opened #10448 to make the alternative fix proposed by @xabbuh. In any case, we hope to see more contributions from you in the future for Symfony Docs. Thanks a lot! |
$isPasswordValid was emty
isPasswordValid attempted UserInterface first argument, string given