File tree 2 files changed +3
-3
lines changed
app/controllers/api_doc_server
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ Set admin username and password in an initializer:
44
44
# config/initializers/api_doc_server.rb
45
45
46
46
ApiDocServer.configure do |config|
47
- config.authentication_proc = proc do |controller|
48
- controller. authenticate_or_request_with_http_basic do |username, password|
47
+ config.authentication_proc = proc
48
+ authenticate_or_request_with_http_basic do |username, password|
49
49
User.find_by(name: username, password: password)
50
50
end
51
51
end
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class ApplicationController < ActionController::Base
11
11
protected
12
12
13
13
def authenticate_admin
14
- ApiDocServer . configuration . authentication_proc . call ( self )
14
+ instance_exec & ApiDocServer . configuration . authentication_proc
15
15
end
16
16
end
17
17
end
You can’t perform that action at this time.
0 commit comments