Created
February 10, 2017 05:35
-
-
Save williamn/09840cf9982a565376dbdc723b7d4223 to your computer and use it in GitHub Desktop.
HTTP Basic authentication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
if ENV["DISALLOW_ALL_WEB_CRAWLERS"].present? | |
http_basic_authenticate_with( | |
name: ENV.fetch("BASIC_AUTH_USERNAME"), | |
password: ENV.fetch("BASIC_AUTH_PASSWORD"), | |
) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment