diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2019-11-17 20:45:02 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2019-11-17 20:45:02 +0100 |
commit | 8df3db566a3a937b45ebf11adb90d265e6f5e2d4 (patch) | |
tree | 4d541098d751d5a9acf8c12f6fb9f308ace066ac /vendor/league/oauth2-client/src/Grant/AuthorizationCode.php | |
download | flyspray-8df3db566a3a937b45ebf11adb90d265e6f5e2d4.tar.xz |
initial checking of customized version 1.0rc9
Diffstat (limited to 'vendor/league/oauth2-client/src/Grant/AuthorizationCode.php')
-rw-r--r-- | vendor/league/oauth2-client/src/Grant/AuthorizationCode.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/vendor/league/oauth2-client/src/Grant/AuthorizationCode.php b/vendor/league/oauth2-client/src/Grant/AuthorizationCode.php new file mode 100644 index 0000000..bda0965 --- /dev/null +++ b/vendor/league/oauth2-client/src/Grant/AuthorizationCode.php @@ -0,0 +1,27 @@ +<?php + +namespace League\OAuth2\Client\Grant; + +use League\OAuth2\Client\Token\AccessToken; + +class AuthorizationCode implements GrantInterface +{ + public function __toString() + { + return 'authorization_code'; + } + + public function prepRequestParams($defaultParams, $params) + { + if (! isset($params['code']) || empty($params['code'])) { + throw new \BadMethodCallException('Missing authorization code'); + } + + return array_merge($defaultParams, $params); + } + + public function handleResponse($response = []) + { + return new AccessToken($response); + } +} |