mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Honor active status for forgotten password request forms
This commit is contained in:
parent
1543cdbc61
commit
aed769c0be
|
@ -4,6 +4,9 @@ namespace App\Http\Controllers\Auth;
|
|||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
|
@ -36,4 +39,18 @@ class ResetPasswordController extends Controller
|
|||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
|
||||
public function showSnipeResetForm(Request $request, $token = null)
|
||||
{
|
||||
// Check that the user is active
|
||||
if ($user = User::where('email', '=',$request->input('email'))->where('activated','=','1')->count() > 0) {
|
||||
return view('auth.passwords.reset')->with(
|
||||
['token' => $token, 'email' => $request->email]
|
||||
);
|
||||
|
||||
}
|
||||
return redirect()->route('password.request')->withErrors(['email' => 'No matching users']);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue