diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-04 23:11:42 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-04 23:11:42 -0200 |
commit | 48c703b055a6b287100f3c0fbc18f1294d7c7af4 (patch) | |
tree | 9cd9e7da96ae9877a2013d1667d373c5dc2df0e6 /railties/lib | |
parent | d3d84988674dde77236d04181b48468765ed56c8 (diff) | |
download | rails-48c703b055a6b287100f3c0fbc18f1294d7c7af4.tar.gz rails-48c703b055a6b287100f3c0fbc18f1294d7c7af4.tar.bz2 rails-48c703b055a6b287100f3c0fbc18f1294d7c7af4.zip |
Make salt argument required for message verifier
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/application.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index df64736e62..e45bfaf6fc 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -169,18 +169,18 @@ module Rails # # ==== Parameters # - # * +verifier_name+ - the name of verifier you want to get. + # * +salt+ - the salt that will be used to generate the secret key of the verifier. # # ==== Examples # - # message = Rails.application.message_verifier.generate('my sensible data') - # Rails.application.message_verifier.verify(message) + # message = Rails.application.message_verifier('salt').generate('my sensible data') + # Rails.application.message_verifier('salt').verify(message) # # => 'my sensible data' # # See the +ActiveSupport::MessageVerifier+ documentation for more information. - def message_verifier(verifier_name = 'default') - @message_verifiers[verifier_name] ||= begin - secret = key_generator.generate_key(verifier_name) + def message_verifier(salt) + @message_verifiers[salt] ||= begin + secret = key_generator.generate_key(salt) ActiveSupport::MessageVerifier.new(secret) end end |