diff --git a/src/OAuth1/AbstractProvider.php b/src/OAuth1/AbstractProvider.php index 5c1add1..9ba50df 100644 --- a/src/OAuth1/AbstractProvider.php +++ b/src/OAuth1/AbstractProvider.php @@ -3,6 +3,7 @@ namespace SocialiteProviders\Manager\OAuth1; use Illuminate\Http\RedirectResponse; +use InvalidArgumentException; use Laravel\Socialite\One\AbstractProvider as BaseProvider; use League\OAuth1\Client\Credentials\TokenCredentials; use SocialiteProviders\Manager\ConfigTrait; @@ -42,7 +43,7 @@ public static function serviceContainerKey($providerName) public function user() { if (!$this->hasNecessaryVerifier()) { - throw new \InvalidArgumentException('Invalid request. Missing OAuth verifier.'); + throw new InvalidArgumentException('Invalid request. Missing OAuth verifier.'); } $token = $this->getToken(); diff --git a/src/OAuth1/Server.php b/src/OAuth1/Server.php index 587289b..73cf2c8 100644 --- a/src/OAuth1/Server.php +++ b/src/OAuth1/Server.php @@ -2,7 +2,9 @@ namespace SocialiteProviders\Manager\OAuth1; +use GuzzleHttp\Client; use GuzzleHttp\Exception\BadResponseException; +use InvalidArgumentException; use League\OAuth1\Client\Credentials\TemporaryCredentials; use League\OAuth1\Client\Server\Server as BaseServer; use SocialiteProviders\Manager\ConfigTrait; @@ -46,7 +48,7 @@ abstract class Server extends BaseServer public function getTokenCredentials(TemporaryCredentials $temporaryCredentials, $temporaryIdentifier, $verifier) { if ($temporaryIdentifier !== $temporaryCredentials->getIdentifier()) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Temporary identifier passed back by server does not match that of stored temporary credentials. Potential man-in-the-middle.' ); @@ -60,7 +62,7 @@ public function getTokenCredentials(TemporaryCredentials $temporaryCredentials, $headers = $this->getHeaders($temporaryCredentials, 'POST', $uri, $bodyParameters); try { - if ('GuzzleHttp\\Client' === get_class($client)) { + if ($client instanceof Client) { $response = $client->post($uri, [ 'headers' => $headers, 'form_params' => $bodyParameters,