Loading patches/006-recovery-email-changes.patch +6 −8 Original line number Diff line number Diff line --- ./core/Controller/LostController.php 2023-05-05 18:38:07.080445742 +0530 +++ ./core/Controller/LostController-new.php 2023-05-05 18:48:27.385043088 +0530 @@ -126,7 +126,24 @@ --- ./core/Controller/LostController.php 2026-03-23 17:46:38.368004410 +0600 +++ ./core/Controller/LostController-new.php 2026-03-23 19:00:49.176323284 +0600 @@ -127,7 +127,23 @@ protected function checkPasswordResetToken(string $token, string $userId): void { try { $user = $this->userManager->get($userId); Loading @@ -22,12 +22,11 @@ + $user = $this->userManager->get($userId); + $recoveryEmail = $this->config->getUserValue($userId, 'email-recovery', 'recovery-email', ''); + $this->verificationToken->check($token, $user, 'lostpassword', $user ? $recoveryEmail : '', true); + } catch (InvalidTokenException $e) { $error = $e->getCode() === InvalidTokenException::TOKEN_EXPIRED ? $this->l10n->t('Could not reset password because the token is expired') @@ -236,9 +253,22 @@ * @throws \OCP\PreConditionNotMetException @@ -237,9 +253,23 @@ * @throws PreConditionNotMetException */ protected function sendEmail(string $input): void { + $legacyDomain = $this->config->getSystemValue('legacy_domain', ''); Loading @@ -45,9 +44,8 @@ + } $user = $this->findUserByIdOrMail($input); $email = $user->getEMailAddress(); - + $email = $this->config->getUserValue($user->getUID(), 'email-recovery', 'recovery-email', ''); if (empty($email)) { throw new ResetPasswordException('Could not send reset e-mail since there is no email for username ' . $input); } Loading
patches/006-recovery-email-changes.patch +6 −8 Original line number Diff line number Diff line --- ./core/Controller/LostController.php 2023-05-05 18:38:07.080445742 +0530 +++ ./core/Controller/LostController-new.php 2023-05-05 18:48:27.385043088 +0530 @@ -126,7 +126,24 @@ --- ./core/Controller/LostController.php 2026-03-23 17:46:38.368004410 +0600 +++ ./core/Controller/LostController-new.php 2026-03-23 19:00:49.176323284 +0600 @@ -127,7 +127,23 @@ protected function checkPasswordResetToken(string $token, string $userId): void { try { $user = $this->userManager->get($userId); Loading @@ -22,12 +22,11 @@ + $user = $this->userManager->get($userId); + $recoveryEmail = $this->config->getUserValue($userId, 'email-recovery', 'recovery-email', ''); + $this->verificationToken->check($token, $user, 'lostpassword', $user ? $recoveryEmail : '', true); + } catch (InvalidTokenException $e) { $error = $e->getCode() === InvalidTokenException::TOKEN_EXPIRED ? $this->l10n->t('Could not reset password because the token is expired') @@ -236,9 +253,22 @@ * @throws \OCP\PreConditionNotMetException @@ -237,9 +253,23 @@ * @throws PreConditionNotMetException */ protected function sendEmail(string $input): void { + $legacyDomain = $this->config->getSystemValue('legacy_domain', ''); Loading @@ -45,9 +44,8 @@ + } $user = $this->findUserByIdOrMail($input); $email = $user->getEMailAddress(); - + $email = $this->config->getUserValue($user->getUID(), 'email-recovery', 'recovery-email', ''); if (empty($email)) { throw new ResetPasswordException('Could not send reset e-mail since there is no email for username ' . $input); }