lib/desk/connection.rb in desk-1.0.8 vs lib/desk/connection.rb in desk-1.0.9
- old
+ new
@@ -17,10 +17,16 @@
:url => api_endpoint,
}
Faraday.new(options) do |builder|
builder.use Faraday::Request::MultipartWithFile
- builder.use Faraday::Request::OAuth, authentication if authenticated?
+ if authenticated?
+ if auth_method == Desk::Authentication::Methods::BASIC
+ builder.use Faraday::Request::BasicAuthentication,basic_auth_username, basic_auth_password
+ else
+ builder.use Faraday::Request::OAuth, authentication
+ end
+ end
builder.use Faraday::Request::Multipart
builder.use Faraday::Request::UrlEncoded
builder.use Faraday::Response::RaiseHttp4xx
builder.use FaradayMiddleware::Deashify unless raw
unless raw