We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 38dc142 commit c1a66bcCopy full SHA for c1a66bc
app.json
@@ -25,7 +25,14 @@
25
},
26
"HEROKU_APP_NAME": {
27
"required": true
28
- }
+ },
29
+ "BASIC_AUTH_USERNAME": {
30
+ "required": true
31
32
+ "BASIC_AUTH_PASSWORD": {
33
34
35
+ "REQUIRE_BASIC_AUTH": "true"
36
37
"image": "heroku/ruby",
38
"buildpacks": [
app/controllers/application_controller.rb
@@ -3,6 +3,14 @@ class ApplicationController < ActionController::Base
3
# For APIs, you may want to use :null_session instead.
4
protect_from_forgery except: :service_sign_in_options
5
6
+
7
+ if ENV["BASIC_AUTH_USERNAME"]
8
+ http_basic_authenticate_with(
9
+ name: ENV.fetch("BASIC_AUTH_USERNAME"),
10
+ password: ENV.fetch("BASIC_AUTH_PASSWORD")
11
+ )
12
+ end
13
14
private
15
16
def content_item_path
0 commit comments