Sha256: d04ad1200dcb7fd38e48f1fe74dda12c7eaf793b6e87019a56a02fa0973fd351

Contents?: true

Size: 496 Bytes

Versions: 7

Compression:

Stored size: 496 Bytes

Contents

module Redd
  module Client
    class Unauthenticated
      module Account
        def login(username, password, remember = false, options = {})
          response = post "/api/login",
            api_type: "json", user: username, passwd: password, rem: remember
          data = response[:json][:data]

          require "redd/client/authenticated"
          Redd::Client::Authenticated.new(
            data[:cookie], data[:modhash], options
          )
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
redd-0.4.3 lib/redd/client/unauthenticated/account.rb
redd-0.4.2 lib/redd/client/unauthenticated/account.rb
redd-0.4.1 lib/redd/client/unauthenticated/account.rb
redd-0.4.0 lib/redd/client/unauthenticated/account.rb
redd-0.3.0 lib/redd/client/unauthenticated/account.rb
redd-0.2.0 lib/redd/client/unauthenticated/account.rb
redd-0.1.6 lib/redd/client/unauthenticated/account.rb