petems / tugboat

A command line tool for interacting with your DigitalOcean droplets.
MIT License
1.45k stars 89 forks source link

bug in connect #211

Closed mxdpeep closed 8 years ago

mxdpeep commented 8 years ago

When not entering the access token, tugboat says incorrectly:

Authentication with DigitalOcean was successful.

then it crashes:

.rvm/gems/ruby-2.2.1/gems/tugboat-2.0.1/lib/tugboat/middleware/list_droplets.rb:10:in call': undefined methodempty?' for nil:NilClass (NoMethodError)

so I assume the authentication message is not correct at all, fixed by entering the token manually to .tugboat

petems commented 8 years ago

Hi @mxdpeep! Yep, looks like this was overlooked, as it used to throw a Faraday error when authentication was wrong, now it just simply returns a hash:

[2] pry(#<Tugboat::Middleware::CheckCredentials>)> env['barge'].droplet.all
=> {"id"=>"unauthorized", "message"=>"Unable to authenticate you."}

I'll get a fix for this out soon!