diff --git a/app/library/Auth.php b/app/library/Auth.php index 2ec49ae..9afb5c0 100644 --- a/app/library/Auth.php +++ b/app/library/Auth.php @@ -44,24 +44,21 @@ class Auth extends Component * Login using OAuth * * @param UserDataInterface $data - * @return bool|\Phalcon\Mvc\Model\MessageInterface[] + * @return bool */ public function loginOauth(UserDataInterface $data) { $user = User::findFirstByOAuthID($data); + // Did not find any user. if (!$user) { - // Did not find any user. create him. - $user = User::createFromOAuthData($data); - - if ($user->save() === false) { - return $user->getMessages(); - } + return false; } + // Here we activate the user. // As for OAuth we perform registration if the user does not exist. // We should therefore activate deleted accounts. - else if ($user->Status == User::STATUS_DELETED) { + if ($user->Status == User::STATUS_DELETED) { $user->Status = User::STATUS_ACTIVE; $user->save(); }