Sha256: ac9248afb3c0ac486a0ed95074e4aa3bc83b4b346fa9f022b01896553f858c3c

Contents?: true

Size: 760 Bytes

Versions: 30

Compression:

Stored size: 760 Bytes

Contents

class TypoWebService < ActionWebService::Base
  attr_accessor :controller

  def initialize(controller)
    @controller = controller
  end

  def this_blog
    controller.send(:this_blog)
  end

  protected

  def authenticate(name, args)
    method = self.class.web_service_api.api_methods[name]

    # Coping with backwards incompatibility change in AWS releases post 0.6.2
    begin
      h = method.expects_to_hash(args)
      raise "Invalid login" unless @user=User.authenticate(h[:username], h[:password])
    rescue NoMethodError
      username, password = method[:expects].index(:username=>String), method[:expects].index(:password=>String)
      raise "Invalid login" unless @user = User.authenticate(args[username], args[password])
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
typo-5.5 app/apis/typo_web_service.rb
typo-5.4.4 app/apis/typo_web_service.rb
typo-5.4.3 app/apis/typo_web_service.rb
typo-5.4.2 app/apis/typo_web_service.rb
typo-5.4.1 app/apis/typo_web_service.rb
typo-5.4 app/apis/typo_web_service.rb
typo-3.99.0 app/apis/typo_web_service.rb
typo-3.99.2 app/apis/typo_web_service.rb
typo-3.99.3 app/apis/typo_web_service.rb
typo-3.99.1 app/apis/typo_web_service.rb
typo-4.0.2 app/apis/typo_web_service.rb
typo-4.0.0 app/apis/typo_web_service.rb
typo-4.0.1 app/apis/typo_web_service.rb
typo-3.99.4 app/apis/typo_web_service.rb
typo-4.1.1 app/apis/typo_web_service.rb
typo-4.0.3 app/apis/typo_web_service.rb
typo-4.1 app/apis/typo_web_service.rb
typo-5.0.1 app/apis/typo_web_service.rb
typo-5.0.2 app/apis/typo_web_service.rb
typo-5.0.3.98.1 app/apis/typo_web_service.rb