mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Add exception handling in the ForgotPasswordController
This commit is contained in:
parent
d2fc98b685
commit
405545cd88
|
@ -71,6 +71,10 @@ class ForgotPasswordController extends Controller
|
|||
* Once we have attempted to send the link, we will examine the response
|
||||
* then see the message we need to show to the user. Finally, we'll send out a proper response.
|
||||
*/
|
||||
|
||||
$response = null;
|
||||
|
||||
try {
|
||||
$response = $this->broker()->sendResetLink(
|
||||
array_merge(
|
||||
$request->only('username'),
|
||||
|
@ -78,6 +82,10 @@ class ForgotPasswordController extends Controller
|
|||
['ldap_import' => '0']
|
||||
)
|
||||
);
|
||||
} catch(\Exception $e) {
|
||||
\Log::info('Password reset attempt: User '.$request->input('username').' doesnt have email setted' );
|
||||
}
|
||||
|
||||
|
||||
if ($response === \Password::RESET_LINK_SENT) {
|
||||
\Log::info('Password reset attempt: User '.$request->input('username').' WAS found, password reset sent');
|
||||
|
|
Loading…
Reference in a new issue