function PasswordInterface::needsRehash

Same name in other branches
  1. 9 core/lib/Drupal/Core/Password/PasswordInterface.php \Drupal\Core\Password\PasswordInterface::needsRehash()
  2. 8.9.x core/lib/Drupal/Core/Password/PasswordInterface.php \Drupal\Core\Password\PasswordInterface::needsRehash()
  3. 10 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 in order to trigger the rehashing of the password, as in that stage, the plain text password is available.

This method returns TRUE if the password was hashed with an older algorithm.

Parameters

string|null $hash: The hash to be checked.

Return value

bool TRUE if the hash is outdated and needs rehash.

2 methods override PasswordInterface::needsRehash()
PhpassHashedPasswordBase::needsRehash in core/lib/Drupal/Core/Password/PhpassHashedPasswordBase.php
Check whether a hashed password needs to be replaced with a new hash.
PhpPassword::needsRehash in core/lib/Drupal/Core/Password/PhpPassword.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);

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