Module: Authlogic::ActsAsAuthentic::PerishableToken::Config

Defined in:
lib/authlogic/acts_as_authentic/perishable_token.rb

Overview

Change how the perishable token works.

Instance Method Summary collapse

Instance Method Details

#disable_perishable_token_maintenance(value = nil) ⇒ Object Also known as: disable_perishable_token_maintenance=

Authlogic tries to expire and change the perishable token as much as possible, without compromising it’s purpose. This is for security reasons. If you want to manage it yourself, you can stop Authlogic from getting your in way by setting this to true.

  • Default: false

  • Accepts: Boolean



39
40
41
# File 'lib/authlogic/acts_as_authentic/perishable_token.rb', line 39

def disable_perishable_token_maintenance(value = nil)
  rw_config(:disable_perishable_token_maintenance, value, false)
end

#perishable_token_valid_for(value = nil) ⇒ Object Also known as: perishable_token_valid_for=

When using the find_using_perishable_token method the token can expire. If the token is expired, no record will be returned. Use this option to specify how long the token is valid for.

  • Default: 10.minutes

  • Accepts: Fixnum



27
28
29
# File 'lib/authlogic/acts_as_authentic/perishable_token.rb', line 27

def perishable_token_valid_for(value = nil)
  rw_config(:perishable_token_valid_for, (!value.nil? && value.to_i) || value, 10.minutes.to_i)
end