diff --git a/oauth/connexion.php b/oauth/connexion.php index 0af596d..f1127c0 100644 --- a/oauth/connexion.php +++ b/oauth/connexion.php @@ -50,8 +50,17 @@ else } catch (Exception $e) { + if ($e->getCode() == 404) { + $resp = json_encode( + [ + "error" => "User not found", + "message" => "$user is not in the group of authorized users." + ] + ); + } else { $resp = json_encode(array("error" => "Impossible to get data", "message" => $e->getMessage())); - $authenticated = false; + } + $authenticated = false; } // If user is authenticated diff --git a/oauth/resource.php b/oauth/resource.php index bd131d8..a93fb59 100755 --- a/oauth/resource.php +++ b/oauth/resource.php @@ -89,7 +89,7 @@ catch (Exception $e) if ($e->getCode() == 404) { $resp = [ "error" => "User not found", - "message" => "$user is not in the group of authorized users." + "message" => "$user is not in the group of authorized users." ]; } else { $resp = array(