Skip to content

Commit

Permalink
allow oauth version in config
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 10, 2022
1 parent dfd188e commit 68afb03
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/SocialiteManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,24 @@ protected function createGitlabDriver()
)->setHost($config['host'] ?? null);
}

/**
* Create an instance of the specified driver.
*
* @return \Laravel\Socialite\One\AbstractProvider
*/
protected function createTwitterDriver()
{
$config = $this->config->get('services.twitter');

if (($config['oauth'] ?? null) === 2) {
return $this->createTwitterOAuth2Driver();
}

return new TwitterProvider(
$this->container->make('request'), new TwitterServer($this->formatConfig($config))
);
}

/**
* Create an instance of the specified driver.
*
Expand Down Expand Up @@ -143,20 +161,6 @@ public function buildProvider($provider, $config)
);
}

/**
* Create an instance of the specified driver.
*
* @return \Laravel\Socialite\One\AbstractProvider
*/
protected function createTwitterDriver()
{
$config = $this->config->get('services.twitter');

return new TwitterProvider(
$this->container->make('request'), new TwitterServer($this->formatConfig($config))
);
}

/**
* Format the server configuration.
*
Expand Down

0 comments on commit 68afb03

Please sign in to comment.