Sha256: 03e3f780c672bd758b4e7f29adca7dc6bfa1b5245fa50e00d18d139f06020384

Contents?: true

Size: 770 Bytes

Versions: 4

Compression:

Stored size: 770 Bytes

Contents

module App42::Command
  class Auth
    class << self

      include App42::Command::UserToken
      include App42::Base::Util

      # @return [TRUE/FALSE]
      def logged_in?
        check_key_file?
      end

      def is_authorize?(api_key, secret_key)
        if api_key.nil? || secret_key.nil?
          message "#{Message::ADD_KEY}", true, 'red'
          puts App42::Base::Help.addkeys
          exit!
        elsif api_key.size == 1 || secret_key.size == 1 
          message "#{Message::WRONG_KEY}", true, 'red'
          puts App42::Base::Help.add
          exit!
        end
      end

      def is_authorize_for_dedicated?
        subscription = App42::Command::Base.new.get_subscription
        return subscription["success"]
      end

    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
app42-0.7.0 lib/app42/command/authorize.rb
app42-0.6.4 lib/app42/command/authorize.rb
app42-0.6.3 lib/app42/command/authorize.rb
app42-0.6.2 lib/app42/command/authorize.rb