mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -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 App\Http\Controllers\Controller;
|
||||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Models\User;
|
|
||||||
|
|
||||||
class ForgotPasswordController extends Controller
|
class ForgotPasswordController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -51,18 +50,15 @@ class ForgotPasswordController extends Controller
|
||||||
public function sendResetLinkEmail(Request $request)
|
public function sendResetLinkEmail(Request $request)
|
||||||
{
|
{
|
||||||
$this->validate($request, ['email' => 'required|email']);
|
$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
|
// 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
|
// 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.
|
// need to show to the user. Finally, we'll send out a proper response.
|
||||||
$response = $this->broker()->sendResetLink(
|
$response = $this->broker()->sendResetLink(
|
||||||
$request->only('email')
|
array_merge(
|
||||||
|
$request->only('email'),
|
||||||
|
['activated' => '1']
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($response === \Password::RESET_LINK_SENT) {
|
if ($response === \Password::RESET_LINK_SENT) {
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'sent' => 'Your password link has been sent!',
|
'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