Skip to content

Commit

Permalink
Upgrade to Manager 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DraperStudio committed Mar 30, 2016
1 parent c5d789a commit 183b550
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"email": "[email protected]"
}],
"require": {
"php": ">=5.5.0",
"socialiteproviders/manager": "~1.0"
"php": "^5.6 || ^7.0",
"socialiteproviders/manager": "~2.0"
},
"autoload": {
"psr-4": {
Expand Down
11 changes: 8 additions & 3 deletions src/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@

namespace SocialiteProviders\xREL;

use Laravel\Socialite\One\AbstractProvider;
use Laravel\Socialite\One\User;
use SocialiteProviders\Manager\OAuth1\AbstractProvider;
use SocialiteProviders\Manager\OAuth1\User;

class Provider extends AbstractProvider
{
/**
* {@inheritDoc}
* Unique Provider Identifier.
*/
const IDENTIFIER = 'XREL';

/**
* {@inheritdoc}
*/
public function user()
{
Expand Down
22 changes: 11 additions & 11 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,46 @@
namespace SocialiteProviders\xREL;

use Guzzle\Http\Exception\BadResponseException;
use Laravel\Socialite\One\User;
use League\OAuth1\Client\Credentials\TokenCredentials;
use League\OAuth1\Client\Server\Server as BaseServer;
use SocialiteProviders\Manager\OAuth1\Server as BaseServer;
use SocialiteProviders\Manager\OAuth1\User;

class Server extends BaseServer
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function urlTemporaryCredentials()
{
return 'http://api.xrel.to/api/oauth/temp_token';
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function urlAuthorization()
{
return 'http://api.xrel.to/api/oauth/authorize';
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function urlTokenCredentials()
{
return 'http://api.xrel.to/api/oauth/access_token';
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function urlUserDetails()
{
return 'http://api.xrel.to/api/user/get_authd_user.json';
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function userDetails($data, TokenCredentials $tokenCredentials)
{
Expand All @@ -58,31 +58,31 @@ public function userDetails($data, TokenCredentials $tokenCredentials)
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function userUid($data, TokenCredentials $tokenCredentials)
{
return $data['id'];
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function userEmail($data, TokenCredentials $tokenCredentials)
{
return;
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function userScreenName($data, TokenCredentials $tokenCredentials)
{
return $data['name'];
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
protected function fetchUserDetails(TokenCredentials $tokenCredentials, $force = true)
{
Expand Down

0 comments on commit 183b550

Please sign in to comment.