Sha256: 6c2bb33043c220aa10bd276d8e836cdf174c5c3f36ca3d344d0a86fe2e75479b

Contents?: true

Size: 497 Bytes

Versions: 50

Compression:

Stored size: 497 Bytes

Contents

module DiscoApp::Admin::Concerns::AuthenticatedController
  extend ActiveSupport::Concern

  included do

    protect_from_forgery with: :exception
    before_action :authenticate_administrator
    layout 'admin'

  end

  private

    def authenticate_administrator
      authenticate_or_request_with_http_basic do |username, password|
        (not username.blank?) && (not password.blank?) && username == ENV['ADMIN_APP_USERNAME'] && password == ENV['ADMIN_APP_PASSWORD']
      end
    end

end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
disco_app-0.10.3 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.10.4 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.10.5 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.11.0 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.11.1 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.12.0 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.12.1 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.12.5 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.12.6 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.12.7 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.13.0 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.13.1 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.13.2 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.13.3 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.13.4 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.13.5 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.13.6 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.13.7 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.13.8 app/controllers/disco_app/admin/concerns/authenticated_controller.rb
disco_app-0.14.1 app/controllers/disco_app/admin/concerns/authenticated_controller.rb