Last Update: 2017-11-21 10:40:35 -0800

New Features

  • A cache_templates configuration method has been added, which can be set to false to disable the default caching of templates. The main time you would want to use this is if you were overriding Rodauth’s templates with your own templates and modifying such templates in development mode. If that is the case, you may want to use something like:

    cache_templates(ENV['RACK_ENV'] != 'development')
  • An invalid_previous_password_message configuration method has been added to the change_password feature, which overrides the default invalid_password_message configuration method if the incorrect previous password is used when changing the password. This is designed for use when invalid_password_message has been overridden and the message doesn’t make sense in the change password case.

  • A json_response_body(hash) configuration method has been added to the jwt feature, allowing for custom formatting of the JSON response body. This is called with the hash to use in the response, and should return a JSON-formatted string. Example:

    json_response_body do |hash|
      super('status'=>response.status, 'detail'=>hash)

Other Improvements

  • In the jwt feature, if json_response_custom_error_status? is set to true, custom error statuses will be used if only_json? is set to true, even if the request is not in JSON format. Previously, custom error statuses were only used if the request was in JSON format.