Skip to content

Commit 75811e5

Browse files
authored
Merge pull request #1174 from CakeDC/feature/gb-1170
fix: xheck if the authenticator is the current one before issuing the…
2 parents 70f8d6a + 1ee2b07 commit 75811e5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Controller/Component/LoginComponent.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,12 @@ protected function handlePasswordRehash($service, $user, \Cake\Http\ServerReques
216216

217217
/** @var \Authentication\Identifier\IdentifierCollection $identifierCollection */
218218
$identifierCollection = $authenticationProvider->getIdentifier();
219+
$authenticators = $service->authenticators();
219220
foreach ($authenticatorNames as $authenticatorName => $identifierName) {
221+
if ($authenticators->has($authenticatorName) && $authenticators->get($authenticatorName) !== $authenticationProvider) {
222+
continue;
223+
}
224+
220225
if (!$identifierCollection->has($identifierName)) {
221226
Log::warning("Error saving user id $user->id password after rehashing: identifier $identifierName not found for authenticator $authenticatorName. Check your Auth.PasswordRehash.authenticators configuration.");
222227
continue;

0 commit comments

Comments
 (0)