mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -08:00
Tweaked code/language for password reset
This commit is contained in:
parent
0100c56046
commit
05b2b8fb59
|
@ -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) {
|
||||
|
|
|
@ -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.',
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue