Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/vendor/league/oauth2-client/src/Grant/AuthorizationCode.php
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 09:05:48 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 09:05:48 +0100
commit6854cb3f4d8219cf1829e32122eb2502a916eae9 (patch)
tree350feb504587d932e02837a1442b059759927646 /vendor/league/oauth2-client/src/Grant/AuthorizationCode.php
initial checkin
Diffstat (limited to 'vendor/league/oauth2-client/src/Grant/AuthorizationCode.php')
-rw-r--r--vendor/league/oauth2-client/src/Grant/AuthorizationCode.php27
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);
+ }
+}