Small clean-up in the auth configuration file.

This commit is contained in:
Taylor Otwell 2011-11-03 13:20:29 -05:00
parent aa55f3441f
commit 9fd503f5b6
1 changed files with 4 additions and 2 deletions

View File

@ -62,9 +62,11 @@
'attempt' => function($username, $password, $config)
{
if ( ! is_null($user = User::where($config['username'], '=', $username)->first()))
$user = User::where($config['username'], '=', $username)->first();
if ( ! is_null($user) and Hasher::check($password, $user->password))
{
if (Hasher::check($password, $user->password)) return $user;
return $user;
}
},