Tweaked code/language for password reset

This commit is contained in:
snipe 2018-08-14 18:09:33 -07:00
parent 0100c56046
commit 05b2b8fb59
2 changed files with 5 additions and 9 deletions

View file

@ -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) {

View file

@ -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.',
];