Skip to content

Commit

Permalink
Fix issue with password rehash with a custom password field
Browse files Browse the repository at this point in the history
  • Loading branch information
chav170 committed Sep 21, 2023
1 parent 0d796dc commit afb616c
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 afb616c

Please sign in to comment.