Merge pull request #9881 from inietov/fixes/integrity_constraint_violation__emailing_password_reset

Fixes Integrity constraint violation when emailing password reset.
This commit is contained in:
snipe 2021-07-30 16:01:53 -07:00 committed by GitHub
commit cdc4940338
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,6 +71,10 @@ class ForgotPasswordController extends Controller
* Once we have attempted to send the link, we will examine the response * 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. * 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( $response = $this->broker()->sendResetLink(
array_merge( array_merge(
$request->only('username'), $request->only('username'),
@ -78,6 +82,10 @@ class ForgotPasswordController extends Controller
['ldap_import' => '0'] ['ldap_import' => '0']
) )
); );
} catch(\Exception $e) {
\Log::info('Password reset attempt: User '.$request->input('username').'failed with exception: '.$e );
}
if ($response === \Password::RESET_LINK_SENT) { if ($response === \Password::RESET_LINK_SENT) {
\Log::info('Password reset attempt: User '.$request->input('username').' WAS found, password reset sent'); \Log::info('Password reset attempt: User '.$request->input('username').' WAS found, password reset sent');