Commit 70e35fb3 authored by Taylor Otwell's avatar Taylor Otwell

refactoring auth class.

parent 06cb63f5
...@@ -5,6 +5,8 @@ class Arr { ...@@ -5,6 +5,8 @@ class Arr {
/** /**
* Get an item from an array. * Get an item from an array.
* *
* If the specified key is null, the entire array will be returned.
*
* @param array $array * @param array $array
* @param string $key * @param string $key
* @param mixed $default * @param mixed $default
......
...@@ -64,11 +64,7 @@ class Auth { ...@@ -64,11 +64,7 @@ class Auth {
if ( ! is_null($user)) if ( ! is_null($user))
{ {
// If a salt is present on the user record, we will recreate the hashed password if ($user->password === Hash::make($password, $user->salt)->value)
// 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)
{ {
static::$user = $user; static::$user = $user;
...@@ -89,6 +85,7 @@ class Auth { ...@@ -89,6 +85,7 @@ class Auth {
public static function logout() public static function logout()
{ {
Session::forget(static::$key); Session::forget(static::$key);
static::$user = null; static::$user = null;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment