Class: ActionDispatch::Cookies::SignedCookieWithDeprecatedTokenJar

Inherits:
SignedCookieJar
  • Object
show all
Defined in:
lib/secret_token_migration/action_dispatch/cookies.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent_jar, secret, options = {}) ⇒ SignedCookieWithDeprecatedTokenJar

Returns a new instance of SignedCookieWithDeprecatedTokenJar.



25
26
27
28
29
30
31
# File 'lib/secret_token_migration/action_dispatch/cookies.rb', line 25

def initialize(parent_jar, secret, options={})
  ensure_secret_secure(secret)
  ensure_secret_secure(options[:deprecated_secret])
  @parent_jar = parent_jar
  @verifier   = ActiveSupport::MessageVerifier.new(secret, options)
  @verifier.instance_variable_set(:@deprecated_secret, options[:deprecated_secret])
end