You are here

protected function GoogleAuthController::getRedirectResponse in Open Social 8.5

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

File

modules/custom/social_auth_google/src/Controller/GoogleAuthController.php, line 55

Class

GoogleAuthController
Class GoogleAuthController.

Namespace

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