Skip to content

Commit

Permalink
Enable basic auth when appropriate env present
Browse files Browse the repository at this point in the history
  • Loading branch information
csutter committed Nov 20, 2023
1 parent 6784225 commit 4b31f16
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4b31f16

Please sign in to comment.