public function password_verify_with_rehash($password, $hash, $uid)
    {
        if (!password_verify($password, $hash)) {
            return false;
        }
    
        if (password_needs_rehash($hash, PASSWORD_DEFAULT, ['cost' => $this->config->bcrypt_cost])) {
            $hash = $this->getHash($password);

            $query = "UPDATE {$this->config->table_users} SET password = ? WHERE id = ?";
            $query_prepared = $this->dbh->prepare($query);
            $query_prepared->execute([$hash, $uid]);
        }
    
        return true;
    }
public function password_verify_with_rehash($password, $hash, $uid)
    {
        if (!password_verify($password, $hash)) {
            return false;
        }
    
        if (password_needs_rehash($hash, PASSWORD_DEFAULT, ['cost' => $this->config->bcrypt_cost])) {
            $hash = $this->getHash($password);

            $query = "UPDATE {$this->config->table_users} SET password = ? WHERE id = ?";
            $query_prepared = $this->dbh->prepare($query);
            $query_prepared->execute([$hash, $uid]);
        }
    
        return true;
    }
public function password_verify_with_rehash ( $ password , $ hash , $ uid ) { if ( ! password_verify ( $ password , $ hash ) ) { return false ; } if ( password_needs_rehash ( $ hash , PASSWORD_DEFAULT , [ 'cost' => $ this -> config -> bcrypt_cost ] ) ) { $ hash = $ this -> getHash ( $ password ) ; $ query = "UPDATE {$this->config->table_users} SET password = ? WHERE id = ?" ; $ query_prepared = $ this -> dbh -> prepare ( $ query ) ; $ query_prepared -> execute ( [ $ hash , $ uid ] ) ; } return true ; }
Check if users password needs to be rehashed
@param string $password
@param string $hash
@param int $uid
@return bool
Check if users password needs to be rehashed