diff --git a/src/modules/Client/Api/Guest.php b/src/modules/Client/Api/Guest.php index e17466120..194d4de15 100644 --- a/src/modules/Client/Api/Guest.php +++ b/src/modules/Client/Api/Guest.php @@ -160,7 +160,7 @@ class Guest extends \Api_Abstract $c = $this->di['db']->findOne('Client', 'email = ?', [$data['email']]); if (!$c instanceof \Model_Client) { - throw new \Box_Exception('Email not found in our database'); + return true; } $hash = hash('sha256', time() . random_bytes(13)); diff --git a/src/modules/Page/html_client/mod_page_password-reset.html.twig b/src/modules/Page/html_client/mod_page_password-reset.html.twig index ab0e3d926..104af9607 100644 --- a/src/modules/Page/html_client/mod_page_password-reset.html.twig +++ b/src/modules/Page/html_client/mod_page_password-reset.html.twig @@ -59,7 +59,7 @@ $(function() { 'guest/client/reset_password', $(this).serialize(), function(result) { - bb.msg("{{ 'Password reset confirmation email was sent'|trans }}"); + bb.msg("{{ 'A password reset confirmation email will be sent to you if we found an account with that email address.'|trans }}"); } ); diff --git a/src/modules/Staff/Api/Guest.php b/src/modules/Staff/Api/Guest.php index dd0b1e4b2..eadcd0829 100644 --- a/src/modules/Staff/Api/Guest.php +++ b/src/modules/Staff/Api/Guest.php @@ -145,7 +145,7 @@ class Guest extends \Api_Abstract $c = $this->di['db']->findOne('Admin', 'email = ?', [$data['email']]); if (!$c instanceof \Model_Admin) { - throw new \Box_Exception('Email not found in our database'); + return true; } $hash = hash('sha256', time() . random_bytes(13)); diff --git a/src/modules/Staff/html_admin/mod_staff_password_reset.html.twig b/src/modules/Staff/html_admin/mod_staff_password_reset.html.twig index 73b47e0da..b9bf3c135 100644 --- a/src/modules/Staff/html_admin/mod_staff_password_reset.html.twig +++ b/src/modules/Staff/html_admin/mod_staff_password_reset.html.twig @@ -15,7 +15,7 @@

{{ 'Reset your password' | trans }}

{{ 'Enter your email address. You will receive a confirmation link if your account exists.' | trans }}

-
+
diff --git a/tests/modules/Client/Api/GuestTest.php b/tests/modules/Client/Api/GuestTest.php index 5a2e34cb1..10d6359bf 100644 --- a/tests/modules/Client/Api/GuestTest.php +++ b/tests/modules/Client/Api/GuestTest.php @@ -295,9 +295,9 @@ class GuestTest extends \BBTestCase { $client = new \Box\Mod\Client\Api\Guest(); $client->setDi($di); - $this->expectException(\Box_Exception::class); - $this->expectExceptionMessage('Email not found in our database'); - $client->reset_password($data); + // expects true because we don't want to give away if the email exists or not + $result = $client->reset_password($data); + $this->assertTrue($result); } public function testconfirm_reset()