Sha256: 2f13c5df2e2130abce1141adcb076c2cd7c03720a25d8ea004f52f560d81ee78

Contents?: true

Size: 422 Bytes

Versions: 11

Compression:

Stored size: 422 Bytes

Contents

module TkhAuthenticationHelper
  def self.included(base)
    base.send(:include, InstanceMethods) 
    # base.before_filter :current_user
    # base.after_filter :my_method_2
  end

  module InstanceMethods
    # duplicated it from action controller extension. there must be a better way
    def current_user
      @current_user ||= User.find_by_auth_token!(cookies[:auth_token]) if cookies[:auth_token]
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tkh_authentication-0.0.11 lib/tkh_authentication/tkh_authentication_helper.rb
tkh_authentication-0.0.10 lib/tkh_authentication/tkh_authentication_helper.rb
tkh_authentication-0.0.9 lib/tkh_authentication/tkh_authentication_helper.rb
tkh_authentication-0.0.8 lib/tkh_authentication/tkh_authentication_helper.rb
tkh_authentication-0.0.7 lib/tkh_authentication/tkh_authentication_helper.rb
tkh_authentication-0.0.6 lib/tkh_authentication/tkh_authentication_helper.rb
tkh_authentication-0.0.5 lib/tkh_authentication/tkh_authentication_helper.rb
tkh_authentication-0.0.4 lib/tkh_authentication/tkh_authentication_helper.rb
tkh_authentication-0.0.3 lib/tkh_authentication/tkh_authentication_helper.rb
tkh_authentication-0.0.2 lib/tkh_authentication/tkh_authentication_helper.rb
tkh_authentication-0.0.1 lib/tkh_authentication/tkh_authentication_helper.rb