diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index ac31e273cb..76f8db430a 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -3,8 +3,8 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; +use App\Models\Setting; use Illuminate\Foundation\Auth\ResetsPasswords; -use App\Models\User; use Illuminate\Http\Request; class ResetPasswordController extends Controller @@ -39,7 +39,39 @@ class ResetPasswordController extends Controller $this->middleware('guest'); } - + protected function rules() + { + return [ + 'token' => 'required', + 'username' => 'required', + 'password' => 'required|confirmed|'.Setting::passwordComplexityRulesSaving('update'), + ]; + } -} + protected function credentials(Request $request) + { + return $request->only( + 'username', 'password', 'password_confirmation', 'token' + ); + } + + + public function showResetForm(Request $request, $token = null) + { + return view('auth.passwords.reset')->with( + [ + 'token' => $token, + 'username' => $request->input('username') + ] + ); + } + + protected function sendResetFailedResponse(Request $request, $response) + { + return redirect()->back() + ->withInput(['username'=> $request->input('username')]) + ->withErrors(['username' => trans($response)]); + } + +} \ No newline at end of file diff --git a/resources/views/auth/passwords/reset.blade.php b/resources/views/auth/passwords/reset.blade.php index 8935bc65e3..946b961a38 100644 --- a/resources/views/auth/passwords/reset.blade.php +++ b/resources/views/auth/passwords/reset.blade.php @@ -31,12 +31,12 @@ -