Skip to content

Commit 30cf3b9

Browse files
committed
Copy helpful comments about original source
Migrate the helpful comments about the method and initial source for the implementation for the original sauron file.
1 parent 7f0bfed commit 30cf3b9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/kracken/controllers/token_authenticatable.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ def self.included(base)
1313
end
1414
end
1515

16-
# NOTE: Monkey-patch until this is merged into the gem
16+
# Customize the `authenticate_or_request_with_http_token` process:
17+
# http://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Token/ControllerMethods.html#method-i-request_http_token_authentication
1718
def request_http_token_authentication(realm = 'Application')
19+
# Modified from https://github.com/rails/rails/blob/60d0aec7/actionpack/lib/action_controller/metal/http_authentication.rb#L490-L499
1820
headers["WWW-Authenticate"] = %(Token realm="#{realm.gsub(/"/, "")}")
1921
raise TokenUnauthorized, "Invalid Credentials"
2022
end

0 commit comments

Comments
 (0)