diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-29 18:11:36 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-29 18:11:36 -0700 |
commit | 49ba2710e9fa01c2bedaf306552fae6f3301a119 (patch) | |
tree | d31aa9efb4bd4dd5aa1a000d4a6f53dc854ce6b3 | |
parent | e5e2bbdc5303f6ff388c2dffe34b7e9335d3c953 (diff) | |
download | rails-49ba2710e9fa01c2bedaf306552fae6f3301a119.tar.gz rails-49ba2710e9fa01c2bedaf306552fae6f3301a119.tar.bz2 rails-49ba2710e9fa01c2bedaf306552fae6f3301a119.zip |
add a method for getting the http auth salt
-rw-r--r-- | actionpack/lib/action_controller/metal/http_authentication.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb index 5ba6b4c645..15d4562abb 100644 --- a/actionpack/lib/action_controller/metal/http_authentication.rb +++ b/actionpack/lib/action_controller/metal/http_authentication.rb @@ -260,8 +260,8 @@ module ActionController end def secret_token(request) - key_generator = request.env["action_dispatch.key_generator"] - http_auth_salt = request.env["action_dispatch.http_auth_salt"] + key_generator = request.key_generator + http_auth_salt = request.http_auth_salt key_generator.generate_key(http_auth_salt) end diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 7276c57d28..45600d0a61 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -158,6 +158,10 @@ module ActionDispatch set_header('action_controller.instance'.freeze, controller) end + def http_auth_salt + get_header "action_dispatch.http_auth_salt" + end + def show_exceptions? # :nodoc: # We're treating `nil` as "unset", and we want the default setting to be # `true`. This logic should be extracted to `env_config` and calculated |