diff --git a/apps/encryption/hooks/userhooks.php b/apps/encryption/hooks/userhooks.php index 08b6c15518..b1141030bd 100644 --- a/apps/encryption/hooks/userhooks.php +++ b/apps/encryption/hooks/userhooks.php @@ -296,7 +296,7 @@ class UserHooks implements IHook { public function postPasswordReset($params) { $password = $params['password']; - $this->keyManager->replaceUserKeys($params['uid']); + $this->keyManager->deleteUserKeys($params['uid']); $this->userSetup->setupUser($params['uid'], $password); } diff --git a/apps/encryption/lib/keymanager.php b/apps/encryption/lib/keymanager.php index 1b81936aed..f9a8f7bec3 100644 --- a/apps/encryption/lib/keymanager.php +++ b/apps/encryption/lib/keymanager.php @@ -557,9 +557,11 @@ class KeyManager { } /** + * creat a backup of the users private and public key and then delete it + * * @param string $uid */ - public function replaceUserKeys($uid) { + public function deleteUserKeys($uid) { $this->backupAllKeys('password_reset'); $this->deletePublicKey($uid); $this->deletePrivateKey($uid); diff --git a/apps/encryption/tests/hooks/UserHooksTest.php b/apps/encryption/tests/hooks/UserHooksTest.php index 1aeafad0ba..34cd74cd36 100644 --- a/apps/encryption/tests/hooks/UserHooksTest.php +++ b/apps/encryption/tests/hooks/UserHooksTest.php @@ -251,7 +251,7 @@ class UserHooksTest extends TestCase { public function testPostPasswordReset() { $this->keyManagerMock->expects($this->once()) - ->method('replaceUserKeys') + ->method('deleteUserKeys') ->with('testUser'); $this->userSetupMock->expects($this->once())