diff --git a/typo3/sysext/saltedpasswords/Classes/SaltedPasswordService.php b/typo3/sysext/saltedpasswords/Classes/SaltedPasswordService.php index 9a7b7df94bf2..8e03b041fd07 100644 --- a/typo3/sysext/saltedpasswords/Classes/SaltedPasswordService.php +++ b/typo3/sysext/saltedpasswords/Classes/SaltedPasswordService.php @@ -109,8 +109,8 @@ public function compareUident(array $user, array $loginData, $passwordCompareStr } $defaultHashingClassName = \TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::getDefaultSaltingHashingMethod(); $skip = false; - // Test for wrong salted hashing method - if ($validPasswd && !(get_class($this->objInstanceSaltedPW) == $defaultHashingClassName) || is_subclass_of($this->objInstanceSaltedPW, $defaultHashingClassName)) { + // Test for wrong salted hashing method (only if current method is not related to default method) + if ($validPasswd && get_class($this->objInstanceSaltedPW) !== $defaultHashingClassName && !is_subclass_of($this->objInstanceSaltedPW, $defaultHashingClassName)) { // Instantiate default method class $this->objInstanceSaltedPW = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance(null); $this->updatePassword((int)$user['uid'], ['password' => $this->objInstanceSaltedPW->getHashedPassword($password)]);