Sha256: c21721b53c36435d2e540d2d3e3167c6594e5f5ccd0b460a9c564880c90169a6

Contents?: true

Size: 719 Bytes

Versions: 3

Compression:

Stored size: 719 Bytes

Contents

module Authlogic
  module Session
    # = Perishability
    #
    # Maintains the perishable token, which is helpful for confirming records or authorizing records to reset their password. All that this
    # module does is reset it after a session have been saved, just keep it changing. The more it changes, the tighter the security.
    module Perishability
      def self.included(klass)
        klass.after_save :reset_perishable_token!
      end
      
      private
        def reset_perishable_token!
          record.send("reset_#{perishable_token_field}!") if record.respond_to?("reset_#{perishable_token_field}!") && !record.send("disable_#{perishable_token_field}_maintenance?")
        end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
authlogic-1.4.0 lib/authlogic/session/perishability.rb
authlogic-1.4.1 lib/authlogic/session/perishability.rb
authlogic-1.3.9 lib/authlogic/session/perishability.rb