File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ public function post(Request $request)
4444 }
4545 if ($ failing ) {
4646 return Redirect::to ('/user/change-password ' )->withErrors ($ validator )->withInput ();
47+ } elseif ($ request ->input ('current_password ' )==$ request ->input ('new_password ' )) {
48+ return Redirect::back ()->withErrors (['New password must be different than old ' ]);
4749 } else {
4850 $ user ->password_hash = User::generateSaltedHash ($ request ->input ('new_password ' ));
4951 $ user ->save ();
Original file line number Diff line number Diff line change @@ -79,7 +79,9 @@ public function resetPassword(Request $request)
7979 'password_confirm ' => 'required|same:new_password '
8080 );
8181 $ validator = Validator::make (Input::all (), $ validation_rules );
82- if ($ validator ->fails ()) {
82+ if (BaseUser::authenticate ($ user_email , $ request ->input ('new_password ' ))) {
83+ return Redirect::back ()->withErrors (['New password must be different than old ' ]);
84+ } elseif ($ validator ->fails ()) {
8385 return Redirect::back ()->withErrors ($ validator )->withInput ();
8486 } else {
8587 $ user ->password_hash = User::generateSaltedHash ($ request ->input ('new_password ' ));
You can’t perform that action at this time.
0 commit comments