Skip to content

Commit

Permalink
docs: change variable name for clarity in usage docs
Browse files Browse the repository at this point in the history
Resolves #1017

Co-authored-by: Murray Collingwood <[email protected]>
  • Loading branch information
ramsey and murraycollingwood committed Dec 11, 2024
1 parent 0bfe348 commit ba37ec1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ if (!isset($_GET['code'])) {
$provider->setPkceCode($_SESSION['oauth2pkceCode']);

// Try to get an access token using the authorization code grant.
$accessToken = $provider->getAccessToken('authorization_code', [
$tokens = $provider->getAccessToken('authorization_code', [
'code' => $_GET['code']
]);

// We have an access token, which we may use in authenticated
// requests against the service provider's API.
echo 'Access Token: ' . $accessToken->getToken() . "<br>";
echo 'Refresh Token: ' . $accessToken->getRefreshToken() . "<br>";
echo 'Expired in: ' . $accessToken->getExpires() . "<br>";
echo 'Already expired? ' . ($accessToken->hasExpired() ? 'expired' : 'not expired') . "<br>";
echo 'Access Token: ' . $tokens->getToken() . "<br>";
echo 'Refresh Token: ' . $tokens->getRefreshToken() . "<br>";
echo 'Expired in: ' . $tokens->getExpires() . "<br>";
echo 'Already expired? ' . ($tokens->hasExpired() ? 'expired' : 'not expired') . "<br>";

// Using the access token, we may look up details about the
// resource owner.
Expand Down

0 comments on commit ba37ec1

Please sign in to comment.