Skip to content

Commit

Permalink
chore: update Authorization to not use Bearer id
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke committed Nov 2, 2021
1 parent 339ade7 commit e8c2508
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ $client = new \OwenVoke\POAP\Client();
$repositories = $client->event()->showBySlug('pest-php-meetup-1-2021');
```

**Authentication**

> Note: The POAP API only supports authentication via an API token.
```php
use OwenVoke\POAP\Client;
$client = new Client();
$client->authenticate($apiToken, null, Client::AUTH_ACCESS_TOKEN);
```

## Change log

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
Expand Down
2 changes: 1 addition & 1 deletion src/HttpClient/Plugin/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private function getAuthorizationHeader(): string
{
switch ($this->method) {
case Client::AUTH_ACCESS_TOKEN:
return sprintf('Bearer %s', $this->tokenOrLogin);
return $this->tokenOrLogin;
default:
throw new RuntimeException(sprintf('%s not yet implemented', $this->method));
}
Expand Down

0 comments on commit e8c2508

Please sign in to comment.