refactoring auth class.

This commit is contained in:
Taylor Otwell
2011-07-07 23:00:40 -05:00
parent 06cb63f502
commit 70e35fb3d7
2 changed files with 4 additions and 5 deletions

View File

@@ -64,11 +64,7 @@ class Auth {
if ( ! is_null($user))
{
// If a salt is present on the user record, we will recreate the hashed password
// using the salt. Otherwise, we will just use a plain hash.
$password = (isset($user->salt)) ? Hash::make($password, $user->salt)->value : sha1($password);
if ($user->password === $password)
if ($user->password === Hash::make($password, $user->salt)->value)
{
static::$user = $user;
@@ -89,6 +85,7 @@ class Auth {
public static function logout()
{
Session::forget(static::$key);
static::$user = null;
}