diff --git a/RestControllers/userController.php b/RestControllers/userController.php index e8e881d..6468084 100644 --- a/RestControllers/userController.php +++ b/RestControllers/userController.php @@ -30,7 +30,7 @@ class userController //Try to perform login $loginTokens = CS::get()->components->user->generateUserLoginTokens($userMail, $userPassword, APIServiceID, $db); - if(!$loginTokens) + if(count($loginTokens) == 0) throw new RestException(401, "Invalid e-mail address / password !"); //Return result with tokens diff --git a/classes/components/user.php b/classes/components/user.php index 9694876..6fc56dc 100644 --- a/classes/components/user.php +++ b/classes/components/user.php @@ -43,7 +43,7 @@ class User{ //Check if there is anything if(count($userInfos) == 0) - return false; //Not any account was found + return array(); //Not any account was found //Extract first value ID $userID = $userInfos[0]['ID']; @@ -69,7 +69,7 @@ class User{ "token2" => $token2 ); if(!CS::get()->db->addLine($tableName, $insertValues)) - return false; //Something went wrong + return array(); //Something went wrong //We can return tokens return array($token1, $token2);