From 61720e88930c5a60477450696613df43dcd9a9e8 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 16 Sep 2026 00:10:33 +0200 Subject: [PATCH] chore(core): drop the password reset hooks in favour of the typed events pre_passwordReset and post_passwordReset have no listeners and are already covered by BeforePasswordResetEvent and PasswordResetEvent, dispatched on the preceding lines and consumed by the encryption app. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Ferdinand Thiessen --- core/Controller/LostController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php index a402c358cc88c..57e085c89bd57 100644 --- a/core/Controller/LostController.php +++ b/core/Controller/LostController.php @@ -51,7 +51,7 @@ /** * Class LostController * - * Successfully changing a password will emit the post_passwordReset hook. + * Successfully changing a password will dispatch a PasswordResetEvent. * * @package OC\Core\Controller */ @@ -203,7 +203,6 @@ public function setPassword(string $token, string $userId, string $password, boo $user = $this->userManager->get($userId); $this->eventDispatcher->dispatchTyped(new BeforePasswordResetEvent($user, $password)); - \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'pre_passwordReset', ['uid' => $userId, 'password' => $password]); if (strlen($password) > IUserManager::MAX_PASSWORD_LENGTH) { throw new HintException('Password too long', $this->l10n->t('Password is too long. Maximum allowed length is 469 characters.')); @@ -214,7 +213,6 @@ public function setPassword(string $token, string $userId, string $password, boo } $this->eventDispatcher->dispatchTyped(new PasswordResetEvent($user, $password)); - \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'post_passwordReset', ['uid' => $userId, 'password' => $password]); $this->twoFactorManager->clearTwoFactorPending($userId);