Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Return preconfigured AS::MessageVerifier

  • Loading branch information...
commit 629f4e007c1e80b931ed3d3a2553ad26997d8345 1 parent cfbedd3
@strzalek strzalek authored
Showing with 7 additions and 1 deletion.
  1. +6 −0 railties/CHANGELOG.md
  2. +1 −1  railties/lib/rails/application.rb
View
6 railties/CHANGELOG.md
@@ -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.
View
2  railties/lib/rails/application.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.