Refactor Auth class to use new bcrypt hashing.

This commit is contained in:
Taylor Otwell 2011-07-11 12:25:12 -07:00
parent 427fe62568
commit 757e1280a8
1 changed files with 2 additions and 2 deletions

View File

@ -59,11 +59,11 @@ public static function user()
*/
public static function login($username, $password)
{
$model = forward_static_call(array(static::model(), 'where'), Config::get('auth.username'), '=', $username)->first();
$user = forward_static_call(array(static::model(), 'where'), Config::get('auth.username'), '=', $username)->first();
if ( ! is_null($user))
{
if ($user->password === Hash::make($password, $user->salt)->value)
if (Hash::check($password, $user->password))
{
static::$user = $user;