Sha256: 3c1e85557961aa8bd7333904b145e3de8efbea15746372a5a269f90100e2b79f

Contents?: true

Size: 536 Bytes

Versions: 20

Compression:

Stored size: 536 Bytes

Contents

module Maily
  class ApplicationController < Maily.base_controller.constantize
    before_action :maily_enabled?, :http_authorization

    layout 'maily/application'

    private

    def maily_enabled?
      Maily.enabled || head(404, message: "Maily disabled")
    end

    def http_authorization
      if auth_hash = Maily.http_authorization
        authenticate_or_request_with_http_basic do |username, password|
          username == auth_hash[:username] && password == auth_hash[:password]
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
maily-1.0.0 app/controllers/maily/application_controller.rb
maily-0.12.3 app/controllers/maily/application_controller.rb
maily-0.12.2 app/controllers/maily/application_controller.rb
maily-0.12.1 app/controllers/maily/application_controller.rb
maily-0.12.0 app/controllers/maily/application_controller.rb
maily-0.11.0 app/controllers/maily/application_controller.rb
maily-0.10.1 app/controllers/maily/application_controller.rb
maily-0.10.0 app/controllers/maily/application_controller.rb
maily-0.9.1 app/controllers/maily/application_controller.rb
maily-0.9.0 app/controllers/maily/application_controller.rb
maily-0.8.2 app/controllers/maily/application_controller.rb
maily-0.8.1 app/controllers/maily/application_controller.rb
maily-0.8.0 app/controllers/maily/application_controller.rb
maily-0.7.2 app/controllers/maily/application_controller.rb
maily-0.7.1 app/controllers/maily/application_controller.rb
maily-0.7.0 app/controllers/maily/application_controller.rb
maily-0.6.3 app/controllers/maily/application_controller.rb
maily-0.6.2 app/controllers/maily/application_controller.rb
maily-0.6.1 app/controllers/maily/application_controller.rb
maily-0.6.0 app/controllers/maily/application_controller.rb