aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-11-22 00:02:10 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-12-04 22:56:48 -0200
commitf98bd42854cc00868cd3f17fe164f32be7315d6b (patch)
treee1bb29eb3baba3635e874e2db14b2b80489e7f8b /railties/lib/rails
parent2be4916e8ee6f36b090df91d28d0c484983dcb5a (diff)
downloadrails-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.rb12
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