You are here

protected function FacebookAuthController::getRedirectResponse in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/social_auth_facebook/src/Controller/FacebookAuthController.php \Drupal\social_auth_facebook\Controller\FacebookAuthController::getRedirectResponse()
  2. 8.2 modules/custom/social_auth_facebook/src/Controller/FacebookAuthController.php \Drupal\social_auth_facebook\Controller\FacebookAuthController::getRedirectResponse()
  3. 8.3 modules/custom/social_auth_facebook/src/Controller/FacebookAuthController.php \Drupal\social_auth_facebook\Controller\FacebookAuthController::getRedirectResponse()
  4. 8.4 modules/custom/social_auth_facebook/src/Controller/FacebookAuthController.php \Drupal\social_auth_facebook\Controller\FacebookAuthController::getRedirectResponse()
  5. 8.5 modules/custom/social_auth_facebook/src/Controller/FacebookAuthController.php \Drupal\social_auth_facebook\Controller\FacebookAuthController::getRedirectResponse()
  6. 8.6 modules/custom/social_auth_facebook/src/Controller/FacebookAuthController.php \Drupal\social_auth_facebook\Controller\FacebookAuthController::getRedirectResponse()
  7. 8.7 modules/custom/social_auth_facebook/src/Controller/FacebookAuthController.php \Drupal\social_auth_facebook\Controller\FacebookAuthController::getRedirectResponse()
  8. 8.8 modules/custom/social_auth_facebook/src/Controller/FacebookAuthController.php \Drupal\social_auth_facebook\Controller\FacebookAuthController::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 FacebookAuthController::getRedirectResponse()
FacebookAuthController::userLogin in modules/custom/social_auth_facebook/src/Controller/FacebookAuthController.php
Response for path 'user/login/facebook'.
FacebookAuthController::userRegister in modules/custom/social_auth_facebook/src/Controller/FacebookAuthController.php
Response for path 'user/register/facebook'.

File

modules/custom/social_auth_facebook/src/Controller/FacebookAuthController.php, line 56

Class

FacebookAuthController
Class FacebookAuthController.

Namespace

Drupal\social_auth_facebook\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);
}