You are here

class BeforeRedirectEvent in Social Auth 3.x

Same name and namespace in other branches
  1. 8.2 src/Event/BeforeRedirectEvent.php \Drupal\social_auth\Event\BeforeRedirectEvent

Dispatched before user is redirected to provider for authentication.

Hierarchy

Expanded class hierarchy of BeforeRedirectEvent

See also

\Drupal\social_auth\Event\SocialAuthEvents

1 file declares its use of BeforeRedirectEvent
UserAuthenticator.php in src/User/UserAuthenticator.php

File

src/Event/BeforeRedirectEvent.php, line 12

Namespace

Drupal\social_auth\Event
View source
class BeforeRedirectEvent extends SocialAuthEventBase {

  /**
   * The Social Auth data handler.
   *
   * @var \Drupal\social_auth\SocialAuthDataHandler
   */
  protected $dataHandler;

  /**
   * The plugin id dispatching this event.
   *
   * @var string
   */
  protected $pluginId;

  /**
   * The destination where use will redirect after successful authentication.
   *
   * @var string
   */
  protected $destination;

  /**
   * BeforeRedirectEvent constructor.
   *
   * @param \Drupal\social_auth\SocialAuthDataHandler $data_handler
   *   The Social Auth data handler.
   * @param string $plugin_id
   *   The plugin Id dispatching this event.
   * @param string $destination
   *   The destination where user will redirect after successful authentication.
   */
  public function __construct(SocialAuthDataHandler $data_handler, $plugin_id, $destination = NULL) {
    $this->dataHandler = $data_handler;
    $this->pluginId = $plugin_id;
    $this->destination = $destination;
  }

  /**
   * Gets the Social Auth data handler object.
   *
   * @return \Drupal\social_auth\SocialAuthDataHandler
   *   The Social Auth data handler.
   */
  public function getDataHandler() {
    return $this->dataHandler;
  }

  /**
   * Gets the plugin id dispatching this event.
   *
   * @return string
   *   The plugin id.
   */
  public function getPluginId() {
    return $this->pluginId;
  }

  /**
   * Gets the destination.
   *
   * @return string
   *   The destination path.
   */
  public function getDestination() {
    return $this->destination;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BeforeRedirectEvent::$dataHandler protected property The Social Auth data handler.
BeforeRedirectEvent::$destination protected property The destination where use will redirect after successful authentication.
BeforeRedirectEvent::$pluginId protected property The plugin id dispatching this event.
BeforeRedirectEvent::getDataHandler public function Gets the Social Auth data handler object.
BeforeRedirectEvent::getDestination public function Gets the destination.
BeforeRedirectEvent::getPluginId public function Gets the plugin id dispatching this event.
BeforeRedirectEvent::__construct public function BeforeRedirectEvent constructor.