Skip to content

Commit

Permalink
Merge pull request #1051 from CakeDC/issue/rehash-custom-password-field
Browse files Browse the repository at this point in the history
Fix issue with password rehash with a custom password field
  • Loading branch information
steinkel authored Sep 21, 2023
2 parents 0d796dc + afb616c commit b81c51d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Controller/Component/LoginComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ protected function handlePasswordRehash($service, $user, \Cake\Http\ServerReques
if (!$checker || method_exists($checker, 'needsPasswordRehash') && !$checker->needsPasswordRehash()) {
continue;
}
$password = $request->getData('password');
$user->set('password', $password);
$passwordField = $checker->getConfig('fields.password', 'password');
$password = $request->getData($passwordField);
$user->set($passwordField, $password);
$user->setDirty('modified');
$this->getController()->getUsersTable()->save($user);
break;
Expand Down

0 comments on commit b81c51d

Please sign in to comment.