Sha256: 150150cce0bae95387eb2bf6f3fdf0f4a7f014ffcf00c1c17bc59431cdccec05

Contents?: true

Size: 521 Bytes

Versions: 15

Compression:

Stored size: 521 Bytes

Contents

module Twurl
  class AuthorizationController < AbstractCommandController
    AUTHORIZATION_FAILED_MESSAGE    = "Authorization failed. Check that your consumer key and secret are correct, as well as username and password."
    AUTHORIZATION_SUCCEEDED_MESSAGE = "Authorization successful"
    def dispatch
      client.exchange_credentials_for_access_token
      client.save
      CLI.puts AUTHORIZATION_SUCCEEDED_MESSAGE
    rescue OAuth::Unauthorized
      raise Exception, AUTHORIZATION_FAILED_MESSAGE
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
twurl-0.9.7 lib/twurl/authorization_controller.rb
twurl-0.9.6 lib/twurl/authorization_controller.rb
twurl-0.9.5 lib/twurl/authorization_controller.rb
twurl-0.9.4 lib/twurl/authorization_controller.rb
twurl-0.9.3 lib/twurl/authorization_controller.rb
twurl-0.9.2 lib/twurl/authorization_controller.rb
twurl-0.9.1 lib/twurl/authorization_controller.rb
twurl-0.9.0 lib/twurl/authorization_controller.rb
twurl-0.8.3 lib/twurl/authorization_controller.rb
twurl-0.8.2 lib/twurl/authorization_controller.rb
twurl-0.8.1 lib/twurl/authorization_controller.rb
twurl-0.8.0 lib/twurl/authorization_controller.rb
twurl-0.7.0 lib/twurl/authorization_controller.rb
twurl-0.6.7 lib/twurl/authorization_controller.rb
twurl-0.6.6 lib/twurl/authorization_controller.rb