Browse Source

Small clean-up in the auth configuration file.

Taylor Otwell 13 years ago
parent
commit
9fd503f5b6
1 changed files with 4 additions and 2 deletions
  1. 4 2
      application/config/auth.php

+ 4 - 2
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;
 		}
 	},