We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f0bfed commit 30cf3b9Copy full SHA for 30cf3b9
lib/kracken/controllers/token_authenticatable.rb
@@ -13,8 +13,10 @@ def self.included(base)
13
end
14
15
16
- # NOTE: Monkey-patch until this is merged into the gem
+ # 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
18
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
20
headers["WWW-Authenticate"] = %(Token realm="#{realm.gsub(/"/, "")}")
21
raise TokenUnauthorized, "Invalid Credentials"
22
0 commit comments