Sha256: f265f5e02f4579e1af924e1f199753af97fd24a2fe6bb91a1576f3e7b31dc765

Contents?: true

Size: 789 Bytes

Versions: 7

Compression:

Stored size: 789 Bytes

Contents

# frozen_string_literal: true

module SolidusAdmin::ControllerHelpers::Authentication
  extend ActiveSupport::Concern

  included do
    before_action :authenticate_solidus_admin_user!

    helper_method :current_solidus_admin_user
    helper_method :solidus_admin_logout_path
    helper_method :solidus_admin_logout_method
  end

  private

  def authenticate_solidus_admin_user!
    send SolidusAdmin::Config.authentication_method if SolidusAdmin::Config.authentication_method
  end

  def current_solidus_admin_user
    send SolidusAdmin::Config.current_user_method if SolidusAdmin::Config.current_user_method
  end

  def solidus_admin_logout_path
    SolidusAdmin::Config.logout_link_path
  end

  def solidus_admin_logout_method
    SolidusAdmin::Config.logout_link_method
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
solidus_admin-0.3.2 app/controllers/solidus_admin/controller_helpers/authentication.rb
solidus_admin-0.3.1 app/controllers/solidus_admin/controller_helpers/authentication.rb
solidus_admin-0.3.0 app/controllers/solidus_admin/controller_helpers/authentication.rb
solidus_admin-0.2.0 app/controllers/solidus_admin/controller_helpers/authentication.rb
solidus_admin-0.1.0 app/controllers/solidus_admin/controller_helpers/authentication.rb
solidus_admin-0.0.2 app/controllers/solidus_admin/controller_helpers/authentication.rb
solidus_admin-0.0.1 app/controllers/solidus_admin/controller_helpers/authentication.rb