You don't pass the hashed password. You pass in the plain-text password, and then Laravel will check the plain text password with the hashed password stored in the database.
Auth::attempt Why? Email or Password
Is there a way to find out why Auth::attempt returned false? Wrong email address? Wrong password?
$email = $request->input('email');
$password = $request->input('password');
$attempt = Auth::attempt(['email' => $email, 'password' => $password]);
if(! $attempt)
{
// Why did $attempt fail? Email or password?
return dd($attempt); // false
}
return dd($attempt); // true
My goal is to find out when the Auth::attempt returns false, why? I am not trying to find out how to fix the code.
What was the reason? Could not find user with that email address or the password was incorrect.
Right now I can only get true/false responses. I am looking for the reason why.
** Updated errors in code.
I guess Guard is just doing SELECT from users where username=x and password=y
If no results are found then the user is not authenticated
After Auth attempt fails you could check the user table for the provided name and if it exists then the password must have been wrong.
Please or to participate in this conversation.