Skip to content

Commit

Permalink
feat: pass x-request-id in every account api requests
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinemetifeu committed Jun 4, 2024
1 parent d8f7afb commit 27f1447
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Api/Client/AccountsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use PrestaShop\Module\PsAccounts\Account\Dto\UpgradeModule;
use PrestaShop\Module\PsAccounts\Http\Client\Guzzle\GuzzleClient;
use PrestaShop\Module\PsAccounts\Http\Client\Guzzle\GuzzleClientFactory;
use Ramsey\Uuid\Uuid;

class AccountsClient
{
Expand Down Expand Up @@ -208,6 +209,7 @@ private function getHeaders($additionalHeaders = [])
'Accept' => 'application/json',
'X-Module-Version' => \Ps_accounts::VERSION,
'X-Prestashop-Version' => _PS_VERSION_,
'X-Request-ID' => Uuid::uuid4()->toString(),
], $additionalHeaders);
}

Expand All @@ -223,6 +225,7 @@ public function verifyToken($idToken)
$this->getClient()->setRoute('/v1/shop/token/verify');

return $this->getClient()->post([
'headers' => $this->getHeaders(),
'json' => [
'token' => $idToken,
],
Expand Down

0 comments on commit 27f1447

Please sign in to comment.