-
Notifications
You must be signed in to change notification settings - Fork 286
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
[1.x] Retrieve user through provider #189
Conversation
This reverts commit f0f8080.
$user = $this->guard->getProvider()->retrieveByCredentials( | ||
$request->only(Fortify::username(), 'password') | ||
); | ||
|
||
return tap($model::where(Fortify::username(), $request->{Fortify::username()})->first(), function ($user) use ($request) { | ||
if (! $user || ! Hash::check($request->password, $user->password)) { | ||
$this->fireFailedEvent($request, $user); | ||
if (! $user) { | ||
$this->fireFailedEvent($request, $user); | ||
|
||
$this->throwFailedAuthenticationException($request); | ||
} | ||
}); | ||
$this->throwFailedAuthenticationException($request); | ||
} | ||
|
||
return $user; |
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.
The verification might be not enough. retrieveByCredentials()
does not expect password matches, only an email address does. Password hash validation is done by validateCredentials()
, but its call was not included in the PR.
I think it is the cause of the PR reverted.
@taylorotwell Is it right?
Re-send for #180