Merge pull request #61 from jamesmills/master

This should fix issue #59
1.0
Ben Corlett 2014-02-10 21:26:55 +11:00
commit 9ad874329b
2 changed files with 14 additions and 1 deletions

View File

@ -5,6 +5,13 @@ namespace League\OAuth2\Client\Provider;
class Eventbrite extends IdentityProvider
{
public function __construct()
{
$this->headers = array(
'Authorization' => 'Bearer'
);
}
public function urlAuthorize()
{
return 'https://www.eventbrite.com/oauth/authorize';

View File

@ -29,6 +29,8 @@ abstract class IdentityProvider
protected $cachedUserDetailsResponse;
public $headers = null;
public function __construct($options = array())
{
foreach ($options as $option => $value) {
@ -171,7 +173,11 @@ abstract class IdentityProvider
try {
$client = new GuzzleClient($url);
$client->setDefaultOption('headers', array('Authorization' => 'Bearer'));
if ($this->headers) {
$client->setDefaultOption('headers', $this->headers);
}
$request = $client->get()->send();
$response = $request->getBody();
$this->cachedUserDetailsResponse = $response;