You are here

protected function TwitterAuthController::getRedirectResponse in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/social_auth_twitter/src/Controller/TwitterAuthController.php \Drupal\social_auth_twitter\Controller\TwitterAuthController::getRedirectResponse()
  2. 8.2 modules/custom/social_auth_twitter/src/Controller/TwitterAuthController.php \Drupal\social_auth_twitter\Controller\TwitterAuthController::getRedirectResponse()
  3. 8.3 modules/custom/social_auth_twitter/src/Controller/TwitterAuthController.php \Drupal\social_auth_twitter\Controller\TwitterAuthController::getRedirectResponse()
  4. 8.4 modules/custom/social_auth_twitter/src/Controller/TwitterAuthController.php \Drupal\social_auth_twitter\Controller\TwitterAuthController::getRedirectResponse()
  5. 8.5 modules/custom/social_auth_twitter/src/Controller/TwitterAuthController.php \Drupal\social_auth_twitter\Controller\TwitterAuthController::getRedirectResponse()
  6. 8.6 modules/custom/social_auth_twitter/src/Controller/TwitterAuthController.php \Drupal\social_auth_twitter\Controller\TwitterAuthController::getRedirectResponse()
  7. 8.7 modules/custom/social_auth_twitter/src/Controller/TwitterAuthController.php \Drupal\social_auth_twitter\Controller\TwitterAuthController::getRedirectResponse()
  8. 8.8 modules/custom/social_auth_twitter/src/Controller/TwitterAuthController.php \Drupal\social_auth_twitter\Controller\TwitterAuthController::getRedirectResponse()

Returns the redirect response.

Parameters

string $type: Type of action, "login" or "register".

Return value

\Drupal\Core\Routing\TrustedRedirectResponse|\Symfony\Component\HttpFoundation\RedirectResponse Returns a RedirectResponse.

2 calls to TwitterAuthController::getRedirectResponse()
TwitterAuthController::userLogin in modules/custom/social_auth_twitter/src/Controller/TwitterAuthController.php
Response for path 'user/login/twitter'.
TwitterAuthController::userRegister in modules/custom/social_auth_twitter/src/Controller/TwitterAuthController.php
Response for path 'user/register/twitter'.

File

modules/custom/social_auth_twitter/src/Controller/TwitterAuthController.php, line 82

Class

TwitterAuthController
Manages requests to Twitter API.

Namespace

Drupal\social_auth_twitter\Controller

Code

protected function getRedirectResponse($type) {
  $sdk = $this
    ->getSdk($type);
  if ($sdk instanceof RedirectResponse) {
    return $sdk;
  }
  $this->authManager
    ->setSdk($sdk);
  $url = $this->authManager
    ->getAuthenticationUrl($type);
  return new TrustedRedirectResponse($url);
}