Skip to content

Commit

Permalink
Misc minor improvements
Browse files Browse the repository at this point in the history
Set the ACCESS_TOKEN_RESOURCE_OWNER_ID key, so that AccessToken objects have their $resourceOwnerId property set

access_token parameter is not needed in URL. Is set in headers automatically. On top, current code is wrong. Parameter $token is a League\OAuth2\Client\Token\AccessToken object, not a string. To append token string to URL, would use this string: $token->getToken()

Remove unused $domain property

Fix some annotations in comments

Use https link in comment instead of http

Remove link to non-existent CHANGELOG.md

All tests and PHP_CodeSniffer pass.
  • Loading branch information
fbonzon committed Sep 28, 2016
1 parent 43967f9 commit 0917023
Show file tree
Hide file tree
Showing 6 changed files with 303 additions and 146 deletions.
13 changes: 5 additions & 8 deletions README.md
Expand Up @@ -23,9 +23,9 @@ Usage is the same as The League's OAuth client, using `\League\OAuth2\Client\Pro

``` php
$provider = new League\OAuth2\Client\Provider\Strava([
'clientId' => '{strava-client-id}',
'clientSecret' => '{strava-client-secret}',
'redirectUri' => 'https://example.com/callback-url',
'clientId' => '{strava-client-id}',
'clientSecret' => '{strava-client-secret}',
'redirectUri' => 'https://example.com/callback-url',
]);

if (!isset($_GET['code'])) {
Expand Down Expand Up @@ -62,17 +62,14 @@ if (!isset($_GET['code'])) {

// Failed to get user details
exit('Oh dear...');

}

// Use this to interact with an API on the users behalf
echo $token->getToken();
}
```

## Change log

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Testing

``` bash
Expand All @@ -94,4 +91,4 @@ If you discover any security related issues, please email :author_email instead

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -35,4 +35,4 @@
"League\\OAuth2\\Client\\Test\\": "tests/src/"
}
}
}
}

0 comments on commit 0917023

Please sign in to comment.