Updated passwordComplexityRulesSaving() signature so it isn’t nullable

This commit is contained in:
snipe 2020-11-02 23:58:37 -08:00
parent b29f794b35
commit a66a22ffb2

View file

@ -29,6 +29,8 @@ class ResetPasswordController extends Controller
*/ */
protected $redirectTo = '/'; protected $redirectTo = '/';
protected $username = 'username';
/** /**
* Create a new controller instance. * Create a new controller instance.
* *
@ -44,7 +46,7 @@ class ResetPasswordController extends Controller
return [ return [
'token' => 'required', 'token' => 'required',
'username' => 'required', 'username' => 'required',
'password' => 'required|confirmed|'.Setting::passwordComplexityRulesSaving('update'), 'password' => 'confirmed|'.Setting::passwordComplexityRulesSaving('store'),
]; ];
} }
@ -59,6 +61,7 @@ class ResetPasswordController extends Controller
public function showResetForm(Request $request, $token = null) public function showResetForm(Request $request, $token = null)
{ {
\Log::debug(print_r($this->rules(),true));
return view('auth.passwords.reset')->with( return view('auth.passwords.reset')->with(
[ [
'token' => $token, 'token' => $token,
@ -67,6 +70,30 @@ class ResetPasswordController extends Controller
); );
} }
// public function reset(Request $request)
// {
// $this->validate($request, $this->rules(), $this->validationErrorMessages());
//
// // These two lines below allow you to bypass the default validation.
// $broker = $this->broker();
// $broker->validate(function () {
// return true;
// });
//
// $response->reset(
// $this->credentials($request), function ($user, $password) {
// \Log::debug('resetting the password to '.$password);
// $this->resetPassword($user, $password);
// }
// );
//
// return $response == \Password::PASSWORD_RESET
// ? $this->sendResetResponse($response)
// : $this->sendResetFailedResponse($request, $response);
// }
protected function sendResetFailedResponse(Request $request, $response) protected function sendResetFailedResponse(Request $request, $response)
{ {
return redirect()->back() return redirect()->back()