Skip to content

Commit

Permalink
Fix: throwing exception in password recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
robertSt7 committed Oct 10, 2023
1 parent 4b480d0 commit 4090c79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Controller/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ public function sendPasswordRecoveryMailAction(Request $request, PasswordRecover
{
if ($request->isMethod(Request::METHOD_POST)) {
try {
$customer = $service->sendRecoveryMail($request->get('email', ''), $this->document->getProperty('password_reset_mail'));
if (!$customer instanceof CustomerInterface) {
throw new \Exception('Invalid Customer');
}
$service->sendRecoveryMail(
$request->get('email', ''),
$this->document->getProperty('password_reset_mail')
);

$this->addFlash('success', $translator->trans('account.reset-mail-sent-when-possible'));
} catch (\Exception $e) {
Expand Down

0 comments on commit 4090c79

Please sign in to comment.