From f98bd42854cc00868cd3f17fe164f32be7315d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 22 Nov 2013 00:02:10 -0200 Subject: No need to configure salts --- railties/lib/rails/application.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'railties/lib/rails') 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 -- cgit v1.2.3