Module: ActionDispatch::Cookies::VerifyAndUpgradeLegacySignedMessage
- Included in:
- UpgradeLegacyEncryptedCookieJar, UpgradeLegacySignedCookieJar
- Defined in:
- lib/action_dispatch/middleware/cookies.rb
Instance Method Summary collapse
- #initialize(*args) ⇒ Object
- #verify_and_upgrade_legacy_signed_message(name, signed_message) ⇒ Object
Instance Method Details
#initialize(*args) ⇒ Object
179 180 181 182 |
# File 'lib/action_dispatch/middleware/cookies.rb', line 179 def initialize(*args) super @legacy_verifier = ActiveSupport::MessageVerifier.new(@options[:secret_token], serializer: NullSerializer) end |
#verify_and_upgrade_legacy_signed_message(name, signed_message) ⇒ Object
184 185 186 187 188 189 190 |
# File 'lib/action_dispatch/middleware/cookies.rb', line 184 def (name, ) deserialize(name, @legacy_verifier.verify()).tap do |value| self[name] = { value: value } end rescue ActiveSupport::MessageVerifier::InvalidSignature nil end |