Sha256: 6a27ca1b6626763f66da7f8c7adc96af8e1870994e533fa7d029227beda79e71

Contents?: true

Size: 763 Bytes

Versions: 6

Compression:

Stored size: 763 Bytes

Contents

module Authlogic
  module Session
    # 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.
    #
    # See Authlogic::ActsAsAuthentic::PerishableToken for more information.
    module PerishableToken
      def self.included(klass)
        klass.after_save :reset_perishable_token!
      end

      private

        def reset_perishable_token!
          if record.respond_to?(:reset_perishable_token) && !record.disable_perishable_token_maintenance?
            record.reset_perishable_token
          end
        end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
authlogic-4.0.1 lib/authlogic/session/perishable_token.rb
authlogic-4.0.0 lib/authlogic/session/perishable_token.rb
authlogic-3.8.0 lib/authlogic/session/perishable_token.rb
authlogic-3.7.0 lib/authlogic/session/perishable_token.rb
authlogic-3.6.1 lib/authlogic/session/perishable_token.rb
authlogic-3.6.0 lib/authlogic/session/perishable_token.rb