This commit is contained in:
Manish Verma
2016-12-13 18:18:25 +05:30
parent fc98add11c
commit 2d8e640e9b
2314 changed files with 97798 additions and 75664 deletions

View File

@@ -4,7 +4,6 @@ namespace Laravel\Socialite\One;
use Illuminate\Http\Request;
use InvalidArgumentException;
use League\OAuth1\Client\Credentials\TokenCredentials;
use League\OAuth1\Client\Server\Server;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Laravel\Socialite\Contracts\Provider as ProviderContract;
@@ -75,31 +74,6 @@ abstract class AbstractProvider implements ProviderContract
]);
}
/**
* Get a Social User instance from a known access token and secret.
*
* @param string $token
* @param string $secret
* @return \Laravel\Socialite\One\User
*/
public function userFromTokenAndSecret($token, $secret)
{
$tokenCredentials = new TokenCredentials();
$tokenCredentials->setIdentifier($token);
$tokenCredentials->setSecret($secret);
$user = $this->server->getUserDetails($tokenCredentials);
$instance = (new User)->setRaw($user->extra)
->setToken($tokenCredentials->getIdentifier(), $tokenCredentials->getSecret());
return $instance->map([
'id' => $user->uid, 'nickname' => $user->nickname,
'name' => $user->name, 'email' => $user->email, 'avatar' => $user->imageUrl,
]);
}
/**
* Get the token credentials for the request.
*