From 05b2b8fb594a9e609eb1ca5c7ed913d92edcd7a3 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 14 Aug 2018 18:09:33 -0700 Subject: [PATCH] Tweaked code/language for password reset --- .../Controllers/Auth/ForgotPasswordController.php | 12 ++++-------- resources/lang/en/passwords.php | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 723ac3b45a..c64710ac38 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -5,7 +5,6 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\SendsPasswordResetEmails; use Illuminate\Http\Request; -use App\Models\User; class ForgotPasswordController extends Controller { @@ -51,18 +50,15 @@ class ForgotPasswordController extends Controller public function sendResetLinkEmail(Request $request) { $this->validate($request, ['email' => 'required|email']); - $valid_user = User::where('email','=',$request->input('email'))->first(); - - if ($valid_user->count() == 0 ) { - return back()->withErrors('error','This email address does not exist, or is not activated.'); - } - // We will send the password reset link to this user. 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 = $this->broker()->sendResetLink( - $request->only('email') + array_merge( + $request->only('email'), + ['activated' => '1'] + ) ); if ($response === \Password::RESET_LINK_SENT) { diff --git a/resources/lang/en/passwords.php b/resources/lang/en/passwords.php index 5195a9b77c..61fe7fbd43 100644 --- a/resources/lang/en/passwords.php +++ b/resources/lang/en/passwords.php @@ -2,6 +2,6 @@ return [ 'sent' => 'Your password link has been sent!', - 'user' => 'That user does not exist or does not have an email address associated', + 'user' => 'No matching active user found with that email.', ];