class GHRH::Auth

Public Class Methods

perform(user, pass) click to toggle source
# File lib/ghrh/auth.rb, line 3
def self.perform(user, pass)
  GHRH::Client.basic_auth user, pass
  body = GHRH::Client.post('/authorizations',
                           { :body => {:scopes => %w{public_repo repo},
                             :note => 'ghrh',
                             :note_url => 'https://github.com/r4um/ghrh'}.to_json})
  token = body['token']
end