module TkhAuthenticationHelper::InstanceMethods

Public Instance Methods

administrator?() click to toggle source

duplicated from action controller extension. there must be a better way

# File lib/tkh_authentication/tkh_authentication_helper.rb, line 15
def administrator?
  @administrator ||= current_user && current_user.admin?
end
current_user() click to toggle source

duplicated from action controller extension. there must be a better way

# File lib/tkh_authentication/tkh_authentication_helper.rb, line 10
def current_user
  @current_user ||= User.find_by!(auth_token: cookies[:auth_token]) if cookies[:auth_token]
end