public function postResetComplete($userId, $code, ResetCompleteRequest $request) { try { $this->dispatchFromArray('Modules\\User\\Commands\\CompleteResetProcessCommand', array_merge($request->all(), ['userId' => $userId, 'code' => $code])); } catch (UserNotFoundException $e) { flash()->error(trans('user::messages.user no longer exists')); return redirect()->back()->withInput(); } catch (InvalidOrExpiredResetCode $e) { flash()->error(trans('user::messages.invalid reset code')); return redirect()->back()->withInput(); } flash()->success(trans('user::messages.password reset')); return redirect()->route('login'); }
public function postResetComplete($userId, $code, ResetCompleteRequest $request) { try { app(UserResetter::class)->finishReset(array_merge($request->all(), ['userId' => $userId, 'code' => $code])); } catch (UserNotFoundException $e) { flash()->error(trans('user::messages.user no longer exists')); return redirect()->back()->withInput(); } catch (InvalidOrExpiredResetCode $e) { flash()->error(trans('user::messages.invalid reset code')); return redirect()->back()->withInput(); } flash()->success(trans('user::messages.password reset')); return redirect()->route('login'); }