You are here

public function FacebookAuthController::__construct in Social Auth Facebook 8

Same name and namespace in other branches
  1. 8.2 src/Controller/FacebookAuthController.php \Drupal\social_auth_facebook\Controller\FacebookAuthController::__construct()
  2. 3.x src/Controller/FacebookAuthController.php \Drupal\social_auth_facebook\Controller\FacebookAuthController::__construct()

FacebookAuthController constructor.

Parameters

\Drupal\social_api\Plugin\NetworkManager $network_manager: Used to get an instance of social_auth_facebook network plugin.

\Drupal\social_auth\SocialAuthUserManager $user_manager: Manages user login/registration.

\Drupal\social_auth_facebook\FacebookAuthManager $facebook_manager: Used to manage authentication methods.

\Symfony\Component\HttpFoundation\RequestStack $request: Used to access GET parameters.

\Drupal\social_auth_facebook\FacebookAuthPersistentDataHandler $persistent_data_handler: FacebookAuthPersistentDataHandler object.

File

src/Controller/FacebookAuthController.php, line 68

Class

FacebookAuthController
Returns responses for Simple FB Connect module routes.

Namespace

Drupal\social_auth_facebook\Controller

Code

public function __construct(NetworkManager $network_manager, SocialAuthUserManager $user_manager, FacebookAuthManager $facebook_manager, RequestStack $request, FacebookAuthPersistentDataHandler $persistent_data_handler) {
  $this->networkManager = $network_manager;
  $this->userManager = $user_manager;
  $this->facebookManager = $facebook_manager;
  $this->request = $request;
  $this->persistentDataHandler = $persistent_data_handler;

  // Sets the plugin id.
  $this->userManager
    ->setPluginId('social_auth_facebook');

  // Sets the session keys to nullify if user could not logged in.
  $this->userManager
    ->setSessionKeysToNullify([
    $this->persistentDataHandler
      ->getSessionPrefix() . 'access_token',
  ]);
}