lib/travis/client/methods.rb in travis-1.9.1.travis.1206.9 vs lib/travis/client/methods.rb in travis-1.9.1.travis.1207.9

- old
+ new

@@ -16,9 +16,13 @@ session.uri end def github_auth(github_token) reply = session.post_raw("/auth/github", :github_token => github_token) + unless reply.respond_to?(:key?) && reply.key?("access_token") + raise InvalidTokenError, 'token is invalid, or does not have sufficient scope; see https://docs.travis-ci.com/user/github-oauth-scopes/ for more information on scope' + end + session.access_token = reply["access_token"] end def explicit_api_endpoint? @explicit_api_endpoint ||= false