Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/vendor/league/oauth2-client/src/Provider/Eventbrite.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/Provider/Eventbrite.php
initial checkin
Diffstat (limited to 'vendor/league/oauth2-client/src/Provider/Eventbrite.php')
-rw-r--r--vendor/league/oauth2-client/src/Provider/Eventbrite.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/vendor/league/oauth2-client/src/Provider/Eventbrite.php b/vendor/league/oauth2-client/src/Provider/Eventbrite.php
new file mode 100644
index 0000000..116051f
--- /dev/null
+++ b/vendor/league/oauth2-client/src/Provider/Eventbrite.php
@@ -0,0 +1,51 @@
+<?php
+
+namespace League\OAuth2\Client\Provider;
+
+use League\OAuth2\Client\Entity\User;
+
+class Eventbrite extends AbstractProvider
+{
+ public $authorizationHeader = 'Bearer';
+
+ public function urlAuthorize()
+ {
+ return 'https://www.eventbrite.com/oauth/authorize';
+ }
+
+ public function urlAccessToken()
+ {
+ return 'https://www.eventbrite.com/oauth/token';
+ }
+
+ public function urlUserDetails(\League\OAuth2\Client\Token\AccessToken $token)
+ {
+ return 'https://www.eventbrite.com/json/user_get';
+ }
+
+ public function userDetails($response, \League\OAuth2\Client\Token\AccessToken $token)
+ {
+ $user = new User();
+ $user->exchangeArray([
+ 'uid' => $response->user->user_id,
+ 'email' => $response->user->email,
+ ]);
+
+ return $user;
+ }
+
+ public function userUid($response, \League\OAuth2\Client\Token\AccessToken $token)
+ {
+ return $response->user->user_id;
+ }
+
+ public function userEmail($response, \League\OAuth2\Client\Token\AccessToken $token)
+ {
+ return isset($response->user->email) && $response->user->email ? $response->user->email : null;
+ }
+
+ public function userScreenName($response, \League\OAuth2\Client\Token\AccessToken $token)
+ {
+ return $response->user->user_id;
+ }
+}