/** * Attempt change password of the user * */ public function do_reset_password() { $input = array('token' => Input::get('token'), 'password' => Input::get('password'), 'password_confirmation' => Input::get('password_confirmation')); // By passing an array with the token, password and confirmation if (Confide::resetPassword($input)) { $notice_msg = Lang::get('confide::confide.alerts.password_reset'); return Redirect::action('UserController@login')->with('notice', $notice_msg); } else { $error_msg = Lang::get('confide::confide.alerts.wrong_password_reset'); return Redirect::action('UserController@reset_password', array('token' => $input['token']))->withInput()->with('error', $error_msg); } }
/** * Attempt change password of the user * */ public function postReset() { $input = array('token' => Input::get('token'), 'password' => Input::get('password'), 'password_confirmation' => Input::get('password_confirmation')); // By passing an array with the token, password and confirmation if (Confide::resetPassword($input)) { return Redirect::to('user/login')->with('notice', Lang::get('confide::confide.alerts.password_reset')); } else { return Redirect::to('user/reset/' . $input['token'])->withInput()->with('error', Lang::get('confide::confide.alerts.wrong_password_reset')); } }
/** * Attempt change password of the user * */ public function do_reset_password() { if (Auth::check()) { $rules = ['password' => 'required|between:4,11|confirmed', 'password_confirmation' => 'between:4,11']; $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { return Redirect::to('user/reset')->withInput()->withErrors($validator); } $user = Auth::user(); $user->password = Input::get('password'); $user->save(); Session::flash('message', trans('texts.confide.password_reset')); return Redirect::to('/dashboard'); } else { $input = array('token' => Input::get('token'), 'password' => Input::get('password'), 'password_confirmation' => Input::get('password_confirmation')); // By passing an array with the token, password and confirmation if (Confide::resetPassword($input)) { $notice_msg = trans('texts.confide.password_reset'); return Redirect::action('UserController@login')->with('notice', $notice_msg); } else { $error_msg = trans('texts.confide.wrong_password_reset'); return Redirect::action('UserController@reset_password', array('token' => $input['token']))->withInput()->with('error', $error_msg); } } }
public function postReset() { $input = array('token' => Input::get('token'), 'password' => Input::get('password'), 'password_confirmation' => Input::get('password_confirmation')); return Confide::resetPassword($input) ? Redirect::to('user/login')->with('success', Lang::get('confide::confide.alerts.password_reset')) : Redirect::to('user/reset/' . $input['token'])->withInput()->with('error', Lang::get('confide::confide.alerts.wrong_password_reset')); }