Skip to content

A free open source IT asset/license management system

Tweaked code/language for password reset

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