Skip to content

Commit

Permalink
Merge pull request #50 from weierophinney/hotfix/personal-access-token
Browse files Browse the repository at this point in the history
When using the REST API, send "token" authorization instead of "bearer"
  • Loading branch information
Ocramius authored Aug 13, 2020
2 parents 4292c20 + 76ae861 commit 881d4a4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Github/Api/V3/CreatePullRequestThroughApiCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __invoke(
)
->withAddedHeader('Content-Type', 'application/json')
->withAddedHeader('User-Agent', 'Ocramius\'s minimal API V3 client')
->withAddedHeader('Authorization', 'bearer ' . $this->apiToken);
->withAddedHeader('Authorization', 'token ' . $this->apiToken);

$request
->getBody()
Expand Down
2 changes: 1 addition & 1 deletion src/Github/Api/V3/CreateReleaseThroughApiCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __invoke(
)
->withAddedHeader('Content-Type', 'application/json')
->withAddedHeader('User-Agent', 'Ocramius\'s minimal API V3 client')
->withAddedHeader('Authorization', 'bearer ' . $this->apiToken);
->withAddedHeader('Authorization', 'token ' . $this->apiToken);

$request
->getBody()
Expand Down
2 changes: 1 addition & 1 deletion src/Github/Api/V3/SetDefaultBranchThroughApiCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __invoke(
)
->withAddedHeader('Content-Type', 'application/json')
->withAddedHeader('User-Agent', 'Ocramius\'s minimal API V3 client')
->withAddedHeader('Authorization', 'bearer ' . $this->apiToken);
->withAddedHeader('Authorization', 'token ' . $this->apiToken);

$request
->getBody()
Expand Down
2 changes: 1 addition & 1 deletion test/unit/Github/Api/V3/CreatePullRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function testSuccessfulRequest(): void
'Host' => ['the-domain.com'],
'Content-Type' => ['application/json'],
'User-Agent' => ['Ocramius\'s minimal API V3 client'],
'Authorization' => ['bearer ' . $this->apiToken],
'Authorization' => ['token ' . $this->apiToken],
],
$request->getHeaders()
);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/Github/Api/V3/CreateReleaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function testSuccessfulRequest(): void
'Host' => ['the-domain.com'],
'Content-Type' => ['application/json'],
'User-Agent' => ['Ocramius\'s minimal API V3 client'],
'Authorization' => ['bearer ' . $this->apiToken],
'Authorization' => ['token ' . $this->apiToken],
],
$request->getHeaders()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function testSuccessfulRequest(): void
'Host' => ['the-domain.com'],
'Content-Type' => ['application/json'],
'User-Agent' => ['Ocramius\'s minimal API V3 client'],
'Authorization' => ['bearer ' . $this->apiToken],
'Authorization' => ['token ' . $this->apiToken],
],
$request->getHeaders()
);
Expand Down Expand Up @@ -117,7 +117,7 @@ public function testRequestFailedToSwitchBranch(): void
'Host' => ['the-domain.com'],
'Content-Type' => ['application/json'],
'User-Agent' => ['Ocramius\'s minimal API V3 client'],
'Authorization' => ['bearer ' . $this->apiToken],
'Authorization' => ['token ' . $this->apiToken],
],
$request->getHeaders()
);
Expand Down

0 comments on commit 881d4a4

Please sign in to comment.