You are here

public function PasswordInterface::needsRehash in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Password/PasswordInterface.php \Drupal\Core\Password\PasswordInterface::needsRehash()
  2. 9 core/lib/Drupal/Core/Password/PasswordInterface.php \Drupal\Core\Password\PasswordInterface::needsRehash()

Check whether a hashed password needs to be replaced with a new hash.

This is typically called during the login process when the plain text password is available. A new hash is needed when the desired iteration count has changed by a modification of the password-service in the dependency injection container or if the user's password hash was generated in an update like user_update_7000() (see the Drupal 7 documentation).

Parameters

string $hash: The existing hash to be checked.

Return value

bool TRUE if the hash is outdated and needs rehash.

1 method overrides PasswordInterface::needsRehash()
PhpassHashedPassword::needsRehash in core/lib/Drupal/Core/Password/PhpassHashedPassword.php
Check whether a hashed password needs to be replaced with a new hash.

File

core/lib/Drupal/Core/Password/PasswordInterface.php, line 55

Class

PasswordInterface
Secure password hashing functions for user authentication.

Namespace

Drupal\Core\Password

Code

public function needsRehash($hash);