Sha256: bed75ddca28d6649f4e228956efe1c2ee4d61061f510e300735cb7a789b4f36b

Contents?: true

Size: 459 Bytes

Versions: 1

Compression:

Stored size: 459 Bytes

Contents

module Madmin
  class ApplicationController < Madmin::BaseController
    before_action :authenticate_admin_user

    def authenticate_admin_user
      # TODO: Add your authentication logic here

      # For example, with Rails 8 authentication
      # redirect_to "/", alert: "Not authorized." unless authenticated? && Current.user.admin?

      # Or with Devise
      # redirect_to "/", alert: "Not authorized." unless current_user&.admin?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
madmin-2.0.0 lib/generators/madmin/install/templates/controller.rb.tt