@@ -1,18 +1,18 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$provider = require __DIR__ . '/provider.php'; |
|
| 3 | +$provider = require __DIR__.'/provider.php'; |
|
| 4 | 4 | |
| 5 | 5 | if (!empty($_GET['error'])) { |
| 6 | 6 | |
| 7 | 7 | // Got an error, probably user denied access |
| 8 | - exit('Got error: ' . $_GET['error']); |
|
| 8 | + exit('Got error: '.$_GET['error']); |
|
| 9 | 9 | |
| 10 | 10 | } elseif (empty($_GET['code'])) { |
| 11 | 11 | |
| 12 | 12 | // If we don't have an authorization code then get one |
| 13 | 13 | $authUrl = $provider->getAuthorizationUrl(); |
| 14 | 14 | $_SESSION['oauth2state'] = $provider->getState(); |
| 15 | - header('Location: ' . $authUrl); |
|
| 15 | + header('Location: '.$authUrl); |
|
| 16 | 16 | exit; |
| 17 | 17 | |
| 18 | 18 | } elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require __DIR__ . '/../vendor/autoload.php'; |
|
| 3 | +require __DIR__.'/../vendor/autoload.php'; |
|
| 4 | 4 | |
| 5 | 5 | use Hayageek\OAuth2\Client\Provider\Yahoo; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$provider = require __DIR__ . '/provider.php'; |
|
| 3 | +$provider = require __DIR__.'/provider.php'; |
|
| 4 | 4 | |
| 5 | 5 | unset($_SESSION['token'], $_SESSION['state']); |
| 6 | 6 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | // We got an access token, let's now get the user's details |
| 18 | - $ownerDetails = $provider->getResourceOwner($token); |
|
| 18 | + $ownerDetails = $provider->getResourceOwner($token); |
|
| 19 | 19 | |
| 20 | 20 | // Use these details to create a new profile |
| 21 | 21 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$provider = require __DIR__ . '/provider.php'; |
|
| 3 | +$provider = require __DIR__.'/provider.php'; |
|
| 4 | 4 | |
| 5 | 5 | if (!empty($_SESSION['token'])) { |
| 6 | 6 | $token = unserialize($_SESSION['token']); |
@@ -29,19 +29,19 @@ discard block |
||
| 29 | 29 | } catch (Exception $e) { |
| 30 | 30 | |
| 31 | 31 | // Failed to get user details |
| 32 | - exit('Something went wrong: ' . $e->getMessage()); |
|
| 32 | + exit('Something went wrong: '.$e->getMessage()); |
|
| 33 | 33 | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | // Use this to interact with an API on the users behalf |
| 38 | -echo "Token: ". $token->getToken()."<br>"; |
|
| 38 | +echo "Token: ".$token->getToken()."<br>"; |
|
| 39 | 39 | |
| 40 | 40 | // Use this to get a new access token if the old one expires |
| 41 | 41 | echo "Refresh Token: ".$token->getRefreshToken()."<br>"; |
| 42 | 42 | |
| 43 | 43 | // Number of seconds until the access token will expire, and need refreshing |
| 44 | -echo "Expires:" .$token->getExpires()."<br>"; |
|
| 44 | +echo "Expires:".$token->getExpires()."<br>"; |
|
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | echo "After Refreshing Token <br>"; |
@@ -50,10 +50,10 @@ discard block |
||
| 50 | 50 | $token = $provider->getAccessToken($grant, ['refresh_token' => $token->getRefreshToken()]); |
| 51 | 51 | |
| 52 | 52 | // Use this to interact with an API on the users behalf |
| 53 | -echo "Token: ". $token->getToken()."<br>"; |
|
| 53 | +echo "Token: ".$token->getToken()."<br>"; |
|
| 54 | 54 | |
| 55 | 55 | // Use this to get a new access token if the old one expires |
| 56 | 56 | echo "Refresh Token: ".$token->getRefreshToken()."<br>"; |
| 57 | 57 | |
| 58 | 58 | // Number of seconds until the access token will expire, and need refreshing |
| 59 | -echo "Expires:" .$token->getExpires()."<br>"; |
|
| 59 | +echo "Expires:".$token->getExpires()."<br>"; |
|
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | protected $language = "en-us"; |
| 22 | 22 | |
| 23 | - private $imageSize='192x192'; |
|
| 23 | + private $imageSize = '192x192'; |
|
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | public function getBaseAuthorizationUrl() |