lib/github_api/authorization.rb in github_api-0.2.2 vs lib/github_api/authorization.rb in github_api-0.3.0
- old
+ new
@@ -40,9 +40,14 @@
def get_token(authorization_code, params = {})
_verify_client
@client.auth_code.get_token(authorization_code, params)
end
+ # Check whether authentication credentials are present
+ def authenticated?
+ basic_auth? || oauth_token? || (login? && password?)
+ end
+
private
def _verify_client # :nodoc:
raise ArgumentError, 'Need to provide client_id and client_secret' unless client_id? && client_secret?
end