diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index e581fb9ab..9dbabec30 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -479,7 +479,6 @@ class AuthComponent extends Object { if (empty($data) || empty($data[$this->userModel])) { return null; } - return $data[$this->userModel]; } else if (is_numeric($user)) { // Assume it's a user's ID $model =& $this->getUserModel(); @@ -488,6 +487,11 @@ class AuthComponent extends Object { if (empty($data) || empty($data[$this->userModel])) { return null; } + } + if (isset($data) && !empty($data)) { + if(!empty($data[$this->userModel][$this->fields['password']])) { + unset($data[$this->userModel][$this->fields['password']]); + } return $data[$this->userModel]; } else { return null;