You are here

public function Cookie::authenticate in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/user/src/Authentication/Provider/Cookie.php \Drupal\user\Authentication\Provider\Cookie::authenticate()

Authenticates the user.

Parameters

\Symfony\Component\HttpFoundation\Request|NULL $request: The request object.

Return value

\Drupal\Core\Session\AccountInterface|NULL AccountInterface - in case of a successful authentication. NULL - in case where authentication failed.

Overrides AuthenticationProviderInterface::authenticate

File

core/modules/user/src/Authentication/Provider/Cookie.php, line 60
Contains \Drupal\user\Authentication\Provider\Cookie.

Class

Cookie
Cookie based authentication provider.

Namespace

Drupal\user\Authentication\Provider

Code

public function authenticate(Request $request) {
  return $this
    ->getUserFromSession($request
    ->getSession());
}