Nabil Lemsieh
Nabil Lemsieh

Reputation: 716

Laravel - Hash::check() return always false

Hello I'm using Laravel 4 and I want to check if a user's password exists in the database, so I do this :

 Return Hash::check($password, Auth::user()->password);

The problem I get always false even $password value is correct

Upvotes: 0

Views: 868

Answers (1)

The Alpha
The Alpha

Reputation: 146191

You have used this:

Return Hash::check($password, Auth::user()->password);

It always returns false because Auth::user()->password); will be available only when the user is logged in and I'm assuming that, you are checking the password when the user is not logged in.

Upvotes: 3

Related Questions