Skip to content

Commit

Permalink
Merge pull request #10089 from touhidurabir/i10065_patch_main
Browse files Browse the repository at this point in the history
#10065 fixed rehash issue
  • Loading branch information
touhidurabir authored Jun 19, 2024
2 parents be6564e + 4b66929 commit 609fa98
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 609fa98

Please sign in to comment.