Skip to content

Commit 7f3a42f

Browse files
committed
Merge pull request #9 from auth0/1.x.x-dev
New info headers scheme
2 parents afc12b1 + cfef859 commit 7f3a42f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/JWTAuthBundle.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,24 @@
55
use Auth0\JWTAuthBundle\DependencyInjection\Auth0Extension;
66
use Symfony\Component\HttpKernel\Bundle\Bundle;
77
use Auth0\SDK\API\ApiClient;
8+
use Auth0\SDK\API\InformationHeaders;
89
use Symfony\Component\HttpKernel\Kernel;
910

1011
class JWTAuthBundle extends Bundle
1112
{
12-
const SDK_VERSION = "1.2.1";
13+
const SDK_VERSION = "1.2.2";
1314

1415
public function __construct() {
15-
ApiClient::addHeaderInfoMeta('Symfony:'.Kernel::VERSION);
16-
ApiClient::addHeaderInfoMeta('SDK:'.self::SDK_VERSION);
16+
$oldInfoHeaders = ApiClient::getInfoHeadersData();
17+
18+
if ($oldInfoHeaders) {
19+
$infoHeaders = InformationHeaders::Extend($oldInfoHeaders);
20+
21+
$infoHeaders->setEnvironment('Symfony', Kernel::VERSION);
22+
$infoHeaders->setPackage('jwt-auth-bundle', self::SDK_VERSION);
23+
24+
ApiClient::setInfoHeadersData($infoHeaders);
25+
}
1726
}
1827

1928
public function getAlias()

0 commit comments

Comments
 (0)