diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-11-22 00:02:10 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-04 22:56:48 -0200 |
commit | f98bd42854cc00868cd3f17fe164f32be7315d6b (patch) | |
tree | e1bb29eb3baba3635e874e2db14b2b80489e7f8b /railties/lib/rails | |
parent | 2be4916e8ee6f36b090df91d28d0c484983dcb5a (diff) | |
download | rails-f98bd42854cc00868cd3f17fe164f32be7315d6b.tar.gz rails-f98bd42854cc00868cd3f17fe164f32be7315d6b.tar.bz2 rails-f98bd42854cc00868cd3f17fe164f32be7315d6b.zip |
No need to configure salts
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/application.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 97f3fa8ef3..a2744357ee 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -164,7 +164,8 @@ module Rails # # This verify can be used to generate and verify signed messages in the application. # - # By default all the verifiers will share the same salt. + # It is recommended not to use the same verifier for different things, so you can get different + # verifiers passing the +verifier_name+ argument. # # ==== Parameters # @@ -176,15 +177,10 @@ module Rails # Rails.application.message_verifier.verify(message) # # => 'my sensible data' # - # See the +ActiveSupport::MessageVerifier+ documentation to more information. + # See the +ActiveSupport::MessageVerifier+ documentation for more information. def message_verifier(verifier_name = 'default') @message_verifiers[verifier_name] ||= begin - if config.respond_to?(:message_verifier_salt) - salt = config.message_verifier_salt - end - - salt = salt || 'application verifier' - secret = key_generator.generate_key(salt) + secret = key_generator.generate_key(verifier_name) ActiveSupport::MessageVerifier.new(secret) end end |