diff --git a/src/Controller/Component/LoginComponent.php b/src/Controller/Component/LoginComponent.php index 76794abd1..7178ca0ce 100644 --- a/src/Controller/Component/LoginComponent.php +++ b/src/Controller/Component/LoginComponent.php @@ -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;