function UserController::validatePathParameters

Same name and namespace in other branches
  1. 11.x core/modules/user/src/Controller/UserController.php \Drupal\user\Controller\UserController::validatePathParameters()
  2. 10 core/modules/user/src/Controller/UserController.php \Drupal\user\Controller\UserController::validatePathParameters()

Validates hash and timestamp.

Parameters

\Drupal\user\UserInterface $user: User requesting reset.

int $timestamp: The timestamp.

string $hash: Login link hash.

int $timeout: Link expiration timeout.

Return value

bool Whether the provided data are valid.

Deprecated

in drupal:11.4.0 and is removed from drupal:12.0.0. Use \Drupal\user\OneTimeAuthentication::verifyHmac() instead.

See also

https://www.drupal.org/node/3581062

File

core/modules/user/src/Controller/UserController.php, line 345

Class

UserController
Controller routines for user routes.

Namespace

Drupal\user\Controller

Code

protected function validatePathParameters(UserInterface $user, int $timestamp, string $hash, int $timeout = 0) : bool {
  @trigger_error(__METHOD__ . ' is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. Use \\Drupal\\user\\OneTimeAuthentication::verifyHmac() instead. See https://www.drupal.org/node/3581062', E_USER_DEPRECATED);
  return $this->oneTimeAuthentication
    ->verifyHmac($user, $timestamp, $hash, $timeout);
}

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