Sha256: 1f403b94c676d5c1178696f25efae8ced35c9e00a681e70004d8d427862b5591

Contents?: true

Size: 574 Bytes

Versions: 4

Compression:

Stored size: 574 Bytes

Contents

class Manage::ApplicationController < ActionController::Base
  # before_filter :authenticate_admin_user!
  before_filter :authenticate_admin

  def authenticate_admin
    authenticate_or_request_with_http_basic do |username, password|
      @current_user = AdminUser.where(email: username).first
      return request_http_basic_authentication if @current_user.blank?
      return request_http_basic_authentication unless @current_user.valid_password?(password)
      @current_user
    end
  end

  helper_method :current_user
  def current_user
    @current_user
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
manage-1.2.0 app/controllers/manage/application_controller.rb
manage-1.1.1 app/controllers/manage/application_controller.rb
manage-1.1.0 app/controllers/manage/application_controller.rb
manage-1.0.0 app/controllers/manage/application_controller.rb