From afb616cc9e6abe3786b69218de7af19d32507896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20P=C3=A9rez?= Date: Thu, 21 Sep 2023 16:17:20 +0100 Subject: [PATCH] Fix issue with password rehash with a custom password field --- src/Controller/Component/LoginComponent.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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;