Skip to content

Commit 4299e79

Browse files
authored
Merge pull request #1 from bf4/fix_authentication_proc
Fix authentication_proc intended usage
2 parents 2719c79 + 07f87c6 commit 4299e79

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Set admin username and password in an initializer:
4444
# config/initializers/api_doc_server.rb
4545
4646
ApiDocServer.configure do |config|
47-
config.authentication_proc = proc do |controller|
47+
config.authentication_proc = proc
4848
authenticate_or_request_with_http_basic do |username, password|
4949
User.find_by(name: username, password: password)
5050
end

app/controllers/api_doc_server/application_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ApplicationController < ActionController::Base
1111
protected
1212

1313
def authenticate_admin
14-
ApiDocServer.configuration.authentication_proc.call(self)
14+
instance_exec &ApiDocServer.configuration.authentication_proc
1515
end
1616
end
1717
end

0 commit comments

Comments
 (0)