Sha256: 37cd1504b29e4e89816937b4bcb67714bf9f9309e5617b104363a810416419f5

Contents?: true

Size: 530 Bytes

Versions: 13

Compression:

Stored size: 530 Bytes

Contents

# frozen_string_literal: true

module Maglev
  module Admin
    class BaseController < ::Maglev::ApplicationController
      layout 'maglev/admin/application'

      before_action :maglev_authenticate

      private

      def maglev_authenticate
        username = maglev_config.admin_username
        password = maglev_config.admin_password
        return if !username || !password

        redirect_to main_app.root_path unless authenticate_with_http_basic { |u, p| username == u && password == p }
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
maglevcms-1.2.0 app/controllers/maglev/admin/base_controller.rb
maglevcms-1.1.7 app/controllers/maglev/admin/base_controller.rb
maglevcms-1.1.6 app/controllers/maglev/admin/base_controller.rb
maglevcms-1.1.5 app/controllers/maglev/admin/base_controller.rb
maglevcms-1.1.4 app/controllers/maglev/admin/base_controller.rb
maglevcms-1.1.3 app/controllers/maglev/admin/base_controller.rb
maglevcms-1.1.2 app/controllers/maglev/admin/base_controller.rb
maglevcms-1.1.1 app/controllers/maglev/admin/base_controller.rb
maglevcms-1.1.0 app/controllers/maglev/admin/base_controller.rb
maglevcms-1.0.0 app/controllers/maglev/admin/base_controller.rb
maglevcms-1.0.0.rc3 app/controllers/maglev/admin/base_controller.rb
maglevcms-1.0.0.rc2 app/controllers/maglev/admin/base_controller.rb
maglevcms-1.0.0.rc1 app/controllers/maglev/admin/base_controller.rb