Skip to content

Commit b81c51d

Browse files
authored
Merge pull request #1051 from CakeDC/issue/rehash-custom-password-field
Fix issue with password rehash with a custom password field
2 parents 0d796dc + afb616c commit b81c51d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Controller/Component/LoginComponent.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,9 @@ protected function handlePasswordRehash($service, $user, \Cake\Http\ServerReques
198198
if (!$checker || method_exists($checker, 'needsPasswordRehash') && !$checker->needsPasswordRehash()) {
199199
continue;
200200
}
201-
$password = $request->getData('password');
202-
$user->set('password', $password);
201+
$passwordField = $checker->getConfig('fields.password', 'password');
202+
$password = $request->getData($passwordField);
203+
$user->set($passwordField, $password);
203204
$user->setDirty('modified');
204205
$this->getController()->getUsersTable()->save($user);
205206
break;

0 commit comments

Comments
 (0)