public function reset($email, $token, $password) { try { $user = $this->auth->getUser($email); } catch (JacopoExceptionsInterface $e) { $this->errors->add('user', static::$INVALID_USER_MAIL); throw new UserNotFoundException(); } // Check if the reset password code is valid if ($user->checkResetPasswordCode($token)) { // Attempt to reset the user password if (!$user->attemptResetPassword($token, $password)) { $this->errors->add('user', Config::get('laravel-authentication-acl::messages.flash.error.reset_password_error')); throw new InvalidException(); } } else { $this->errors->add('user', Config::get('laravel-authentication-acl::messages.flash.error.captcha_error')); throw new InvalidException(); } }
public function reset($email, $token, $password) { try { $user = $this->auth->getUser($email); } catch (JacopoExceptionsInterface $e) { $this->errors->add('user', static::$INVALID_USER_MAIL); throw new UserNotFoundException(); } // Check if the reset password code is valid if ($user->checkResetPasswordCode($token)) { // Attempt to reset the user password if (!$user->attemptResetPassword($token, $password)) { $this->errors->add('user', 'There was a problem changing the password.'); throw new InvalidException(); } } else { $this->errors->add('user', 'Confirmation code is not valid.'); throw new InvalidException(); } }