Skip to content

Instantly share code, notes, and snippets.

@Roemerb
Created September 16, 2015 18:00
Show Gist options
  • Save Roemerb/85595761d6292b663830 to your computer and use it in GitHub Desktop.
Save Roemerb/85595761d6292b663830 to your computer and use it in GitHub Desktop.
require 'octokit'
module Gissues
class Github::User < Gissues::Github
def initialize
@client = nil
@token = nil
end
def request_token(username, password)
@client = Octokit::Client.new(:login => username, :password => password)
begin
authorization = @client.create_authorization(:scopes => ["user","repo"], :note => "Gissues CLI issue manager")
@token = authorization[:token]
rescue
puts "Invalid credentials, please try again."
end
end
def signed_in?
@token != nil
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment