lib/agra_api/client.rb in agra_api-0.3.3 vs lib/agra_api/client.rb in agra_api-0.3.4

- old
+ new

@@ -39,11 +39,13 @@ def setup connection.stack do |builder| builder.use Faraday::Request::Multipart builder.use Faraday::Request::UrlEncoded - builder.use Vertebrae::Request::BasicAuth, connection.configuration.authentication if connection.configuration.authenticated? + if connection.configuration.authenticated? + builder.use Faraday::Request::BasicAuthentication, connection.configuration.username, connection.configuration.password + end builder.use Faraday::Response::Logger if ENV['DEBUG'] builder.use FaradayMiddleware::Mashify builder.use FaradayMiddleware::ParseJson @@ -51,6 +53,6 @@ builder.use Vertebrae::Response::RaiseError builder.adapter connection.configuration.adapter end end end -end \ No newline at end of file +end