9 lines
285 B
Ruby
9 lines
285 B
Ruby
|
|
module BasicAuth
|
||
|
|
extend ActiveSupport::Concern
|
||
|
|
|
||
|
|
included do
|
||
|
|
include ActionController::HttpAuthentication::Basic::ControllerMethods
|
||
|
|
http_basic_authenticate_with name: ENV['BASIC_AUTH_USERNAME'],
|
||
|
|
password: ENV['BASIC_AUTH_PASSWORD']
|
||
|
|
end
|
||
|
|
end
|