actually check if github sent a token

This commit is contained in:
Konstantin Haase 2012-12-10 15:49:37 +01:00
parent 3d8c9ed914
commit 44d6c02591

View File

@ -227,7 +227,9 @@ class Travis::Api::App
def get_token(endoint, values) def get_token(endoint, values)
response = Faraday.post(endoint, values) response = Faraday.post(endoint, values)
parameters = Addressable::URI.form_unencode(response.body) parameters = Addressable::URI.form_unencode(response.body)
parameters.assoc("access_token").last token_info = parameters.assoc("access_token")
halt 401, 'could not resolve github token' unless token_info
token_info.last
end end
def parse_scopes(data) def parse_scopes(data)