function UserAuthenticationController::__construct

Same name in other branches
  1. 9 core/modules/user/src/Controller/UserAuthenticationController.php \Drupal\user\Controller\UserAuthenticationController::__construct()
  2. 8.9.x core/modules/user/src/Controller/UserAuthenticationController.php \Drupal\user\Controller\UserAuthenticationController::__construct()
  3. 10 core/modules/user/src/Controller/UserAuthenticationController.php \Drupal\user\Controller\UserAuthenticationController::__construct()

Constructs a new UserAuthenticationController object.

Parameters

\Drupal\user\UserFloodControlInterface $user_flood_control: The user flood control service.

\Drupal\user\UserStorageInterface $user_storage: The user storage.

\Drupal\Core\Access\CsrfTokenGenerator $csrf_token: The CSRF token generator.

\Drupal\user\UserAuthenticationInterface|\Drupal\user\UserAuthInterface $user_auth: The user authentication.

\Drupal\Core\Routing\RouteProviderInterface $route_provider: The route provider.

\Symfony\Component\Serializer\Serializer $serializer: The serializer.

array $serializer_formats: The available serialization formats.

\Psr\Log\LoggerInterface $logger: A logger instance.

File

core/modules/user/src/Controller/UserAuthenticationController.php, line 117

Class

UserAuthenticationController
Provides controllers for login, login status and logout via HTTP requests.

Namespace

Drupal\user\Controller

Code

public function __construct(UserFloodControlInterface $user_flood_control, UserStorageInterface $user_storage, CsrfTokenGenerator $csrf_token, UserAuthenticationInterface|UserAuthInterface $user_auth, RouteProviderInterface $route_provider, Serializer $serializer, array $serializer_formats, LoggerInterface $logger) {
    $this->userFloodControl = $user_flood_control;
    $this->userStorage = $user_storage;
    $this->csrfToken = $csrf_token;
    if (!$user_auth instanceof UserAuthenticationInterface) {
        @trigger_error('The $user_auth parameter implementing UserAuthInterface is deprecated in drupal:10.3.0 and will be removed in drupal:12.0.0. Implement UserAuthenticationInterface instead. See https://www.drupal.org/node/3411040');
    }
    $this->userAuth = $user_auth;
    $this->serializer = $serializer;
    $this->serializerFormats = $serializer_formats;
    $this->routeProvider = $route_provider;
    $this->logger = $logger;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.