Sha256: f0c09560c36f514d7424ffe219c496199b32ec411ebdae906f570607125680a3

Contents?: true

Size: 653 Bytes

Versions: 11

Compression:

Stored size: 653 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}!")
        end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
authlogic-1.3.1 lib/authlogic/session/perishability.rb
authlogic-1.2.2 lib/authlogic/session/perishability.rb
authlogic-1.3.0 lib/authlogic/session/perishability.rb
authlogic-1.3.2 lib/authlogic/session/perishability.rb
authlogic-1.2.1 lib/authlogic/session/perishability.rb
authlogic-1.3.8 lib/authlogic/session/perishability.rb
authlogic-1.3.4 lib/authlogic/session/perishability.rb
authlogic-1.3.3 lib/authlogic/session/perishability.rb
authlogic-1.3.5 lib/authlogic/session/perishability.rb
authlogic-1.3.6 lib/authlogic/session/perishability.rb
authlogic-1.3.7 lib/authlogic/session/perishability.rb