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