From 9fd503f5b622b24d16c5f37c5b115eafca358f9d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 3 Nov 2011 13:20:29 -0500 Subject: [PATCH] Small clean-up in the auth configuration file. --- application/config/auth.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/config/auth.php b/application/config/auth.php index 67aaf41a..56f1872c 100644 --- a/application/config/auth.php +++ b/application/config/auth.php @@ -62,9 +62,11 @@ return array( '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; } },