Permalink
Browse files

Return preconfigured AS::MessageVerifier

  • Loading branch information...
1 parent cfbedd3 commit 629f4e007c1e80b931ed3d3a2553ad26997d8345 @lukaszx0 lukaszx0 committed Aug 8, 2014
Showing with 7 additions and 1 deletion.
  1. +6 −0 railties/CHANGELOG.md
  2. +1 −1 railties/lib/rails/application.rb
View
@@ -1,3 +1,9 @@
+* The `Rails.application.message_verifier` now returns ActiveSupport::MessageVerifier
+ preconfigured with `:digest` and `:serializer` values set to `config.action_dispatch.cookies_digest`
+ and `config.action_dispatch.cookies_serializer` accordingly.
+
+ *Łukasz Strzałkowski*
+
* Add `after_bundle` callbacks in Rails templates. Useful for allowing the
generated binstubs to be added to version control.
@@ -200,7 +200,7 @@ def key_generator
def message_verifier(verifier_name)
@message_verifiers[verifier_name] ||= begin
secret = key_generator.generate_key(verifier_name.to_s)
- ActiveSupport::MessageVerifier.new(secret)
+ ActiveSupport::MessageVerifier.new(secret, digest: config.action_dispatch.cookies_digest, serializer: config.action_dispatch.cookies_serializer)
end
end

0 comments on commit 629f4e0

Please sign in to comment.