Mmanos\Social\SocialController::oauth1Connect PHP Method

oauth1Connect() protected method

Login to an OAuth1 consumer.
protected oauth1Connect ( string $provider, OAuth\Common\Service\AbstractService $service ) : Illuminate\Support\Facades\Redirect
$provider string
$service OAuth\Common\Service\AbstractService
return Illuminate\Support\Facades\Redirect
    protected function oauth1Connect($provider, $service)
    {
        if ($oauth_token = Input::get('oauth_token')) {
            try {
                $token = $service->requestAccessToken($oauth_token, Input::get('oauth_verifier'), $service->getStorage()->retrieveAccessToken($provider)->getRequestTokenSecret());
            } catch (Exception $e) {
                return Redirect::to(Session::pull('mmanos.social.onerror', '/'))->with(Config::get('laravel-social::error_flash_var'), 'There was a problem connecting your account (4).');
            }
            return $this->processConnect($provider, $service, array('token' => $token->getAccessToken(), 'secret' => $token->getAccessTokenSecret()));
        }
        try {
            // Extra request needed for oauth1 to get a request token.
            $token = $service->requestRequestToken();
        } catch (Exception $e) {
            return Redirect::to(Session::pull('mmanos.social.onerror', '/'))->with(Config::get('laravel-social::error_flash_var'), 'There was a problem connecting your account (5).');
        }
        return Redirect::to((string) $service->getAuthorizationUri(array('oauth_token' => $token->getRequestToken())));
    }