You are here

public function CasAttributesSubscriber::onPostLogin in CAS Attributes 8

Same name and namespace in other branches
  1. 2.x src/Subscriber/CasAttributesSubscriber.php \Drupal\cas_attributes\Subscriber\CasAttributesSubscriber::onPostLogin()

Save attributes to user session if sitewide token support is enabled.

Parameters

\Drupal\cas\Event\CasPostLoginEvent $casPostLoginEvent: The post login event from CAS.

File

src/Subscriber/CasAttributesSubscriber.php, line 354

Class

CasAttributesSubscriber
Provides a CasAttributesSubscriber.

Namespace

Drupal\cas_attributes\Subscriber

Code

public function onPostLogin(CasPostLoginEvent $casPostLoginEvent) {
  if ($this->settings
    ->get('sitewide_token_support')) {
    $session = $this->requestStack
      ->getCurrentRequest()
      ->getSession();
    $session
      ->set('cas_attributes', $casPostLoginEvent
      ->getCasPropertyBag()
      ->getAttributes());
  }
}