diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 09705d1..f0dc380 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,2 +1,8 @@ class ApplicationController < ActionController::Base + if ENV["BASIC_AUTH_USERNAME"] && ENV["BASIC_AUTH_PASSWORD"] + http_basic_authenticate_with( + name: ENV.fetch("BASIC_AUTH_USERNAME"), + password: ENV.fetch("BASIC_AUTH_PASSWORD"), + ) + end end