Skip to content

Instantly share code, notes, and snippets.

@elle
Last active December 8, 2017 01:57
Embed
What would you like to do?
Using Rack::Auth::Basic
# config/staging.rb
Rails.application.configure do
config.middleware.use "::Rack::Auth::Basic" do |u, p|
[u, p] == [ENV["BASIC_AUTH_USERNAME"], ENV["BASIC_AUTH_PASSWORD"]]
end
end
# .env
BASIC_AUTH_USERNAME = some_value
BASIC_AUTH_PASSWORD = some_password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment