Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
fix(OAuthManager): don't expose api credentials through exception cal…
Browse files Browse the repository at this point in the history
…lstack
  • Loading branch information
Jens Schulze committed Sep 8, 2015
1 parent a4be01b commit f0caaa1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Client/OAuth/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Commercetools\Core\Client\OAuth;


use Commercetools\Core\Error\ApiException;
use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\ResponseInterface;
use Commercetools\Core\AbstractHttpClient;
Expand Down Expand Up @@ -142,7 +143,11 @@ protected function getBearerToken($scope)
'scope' => $scope . ':' . $this->getConfig()->getProject()
];

$response = $this->execute($data);
try {
$response = $this->execute($data);
} catch (ApiException $exception) {
throw ApiException::create($exception->getRequest(), $exception->getResponse());
}

$result = json_decode($response->getBody(), true);

Expand Down

0 comments on commit f0caaa1

Please # to comment.