Skip to content

Commit

Permalink
#10065 fixed rehash issue
Browse files Browse the repository at this point in the history
  • Loading branch information
touhidurabir committed Jun 19, 2024
1 parent be6564e commit 4b66929
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions classes/core/PKPSessionGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,13 @@ protected function rehashUserPassword($password, $attribute)
throw new InvalidArgumentException('The given password does not match the current password.');
}

return tap($this->user, function(&$user) use ($password) {
return tap($this->user, function(&$user) use ($password, $rehash) {
$rehash ??= Validation::encryptCredentials($user->getUsername(), $password);
$user->setPassword($rehash);

$auth = app()->get('auth'); /** @var \PKP\core\PKPAuthManager $auth */
Application::get()->getRequest()->getSession()->put([
'password_hash_' . app()->get('auth')->getDefaultDriver() => $rehash,
'password_hash_' . $auth->getDefaultDriver() => $rehash,
]);

Repo::user()->edit($user);
Expand Down

0 comments on commit 4b66929

Please sign in to comment.