Skip to content

Commit

Permalink
Replace FCQN with imports. (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Michot authored Sep 8, 2020
1 parent fc8dbcf commit 2dbd9de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/OAuth1/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 4 additions & 2 deletions src/OAuth1/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.'
);
Expand All @@ -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,
Expand Down

0 comments on commit 2dbd9de

Please sign in to comment.