public function resetPassword($id, $code, $password)
{
try {
// Grab the user
$user = $this->sentry->getUserProvider()->findById($id);
// Attempt to reset the user password
if ($user->attemptResetPassword($code, $password)) {
// Fire the 'password reset' event
$this->dispatcher->fire('sentinel.password.reset', ['user' => $user]);
return new SuccessResponse(trans('Sentinel::users.passwordchg'), ['user' => $user]);
}
return new FailureResponse(trans('Sentinel::users.problem'), ['user' => $user]);
} catch (UserNotFoundException $e) {
$message = trans('Sentinel::sessions.invalid');
return new ExceptionResponse($message);
}
}