diff --git a/src/Controller/Component/LoginComponent.php b/src/Controller/Component/LoginComponent.php index 1b502814..3d0d5735 100644 --- a/src/Controller/Component/LoginComponent.php +++ b/src/Controller/Component/LoginComponent.php @@ -216,7 +216,12 @@ protected function handlePasswordRehash($service, $user, \Cake\Http\ServerReques /** @var \Authentication\Identifier\IdentifierCollection $identifierCollection */ $identifierCollection = $authenticationProvider->getIdentifier(); + $authenticators = $service->authenticators(); foreach ($authenticatorNames as $authenticatorName => $identifierName) { + if ($authenticators->has($authenticatorName) && $authenticators->get($authenticatorName) !== $authenticationProvider) { + continue; + } + if (!$identifierCollection->has($identifierName)) { Log::warning("Error saving user id $user->id password after rehashing: identifier $identifierName not found for authenticator $authenticatorName. Check your Auth.PasswordRehash.authenticators configuration."); continue;