Class: Manage::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Manage::ApplicationController
show all
- Defined in:
- app/controllers/manage/application_controller.rb
Instance Method Summary
collapse
Instance Method Details
#authenticate_admin ⇒ Object
5
6
7
8
9
10
11
12
|
# File 'app/controllers/manage/application_controller.rb', line 5
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
|
#current_user ⇒ Object
15
16
17
|
# File 'app/controllers/manage/application_controller.rb', line 15
def current_user
@current_user
end
|