Halnex Halnex - 2 years ago 653
PHP Question

Laravel 5 Auth: These credentials do not match our records

I'm just starting out with Laravel 5, I come from Laravel 4 environment so it shouldn't be too hard.

I heard L5 comes with a built-in authentication system which is neat.
I've set everything up from database to views.

The registration process is working correctly and after that it logs me in automatically. but when I log out and try to log back in, I get this error:

These credentials do not match our records.

I'm not sure what's wrong. do I have to write the login controller manually or how does it work in L5?

Answer Source

I had the same issue. The reason for mine was that I defined setPasswordAttribute in my User model so every time, I enter plain password, it hashes before sending to DB.

public function setPasswordAttribute($password)
    $this->attributes['password'] = \Hash::make($password);

and in my db:seed, I was creating a user with hashed password with Hash::make("password"), too. So laravel hashes hashed password :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download