/**
* Prepare the Twitter client before sending a request
* Reads the oauth token and secret from the Provider for Twitter authentication
*
* @param string $provider_id
* @throws \Exception
*/
protected function prepareRequest($provider_id)
{
$userProvider = $this->providerRepository->get($provider_id);
if (empty($userProvider['oauth_token']) || empty($userProvider['oauth_token_secret'])) {
throw new \Exception('Invalid access token');
}
$this->client->setOauthToken($userProvider['oauth_token'], $userProvider['oauth_token_secret']);
}