You are here

public function GoogleLinkController::linkAccount in Open Social 8.7

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

Response for path 'social-api/link/google'.

Redirects the user to Google for joining accounts.

1 string reference to 'GoogleLinkController::linkAccount'
social_auth_google.routing.yml in modules/custom/social_auth_google/social_auth_google.routing.yml
modules/custom/social_auth_google/social_auth_google.routing.yml

File

modules/custom/social_auth_google/src/Controller/GoogleLinkController.php, line 46

Class

GoogleLinkController
Class GoogleLinkController.

Namespace

Drupal\social_auth_google\Controller

Code

public function linkAccount() {
  $sdk = $this
    ->getSdk();
  if ($sdk instanceof RedirectResponse) {
    return $sdk;
  }
  $this->authManager
    ->setSdk($sdk);
  $url = $this->authManager
    ->getAuthenticationUrl('link');
  return new TrustedRedirectResponse($url);
}