Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Think we may have fixed the problem.

Signed-off-by: Ben Johnson <bjohnson@binarylogic.com>
  • Loading branch information...
commit 70ca165df746de1287f6b5f006c60788c40707c8 1 parent a6c3f3d
Simon Harris authored binarylogic committed
View
2  lib/authlogic/orm_adapters/active_record_adapter/acts_as_authentic/session_maintenance.rb
@@ -39,7 +39,7 @@ def get_session_information
@_logged_out = true
#{options[:session_ids].inspect}.each do |session_id|
- session = #{options[:session_class]}.find(session_id)
+ session = #{options[:session_class]}.find(session_id, self)
if session
if !session.record.blank?
@_logged_out = false
View
4 lib/authlogic/session/base.rb
@@ -61,12 +61,12 @@ def create!(*args)
# UserSession.find(:secure)
#
# See the id method for more information on ids.
- def find(id = nil)
+ def find(id = nil, priority_record = nil)
session = new(id)
session.before_find
if record = session.find_record
session.after_find
- record.save_without_session_maintenance(false) if record.changed?
+ record.save_without_session_maintenance(false) if record.changed? && record != priority_record
session
else
nil
View
10 ...rm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/credentials_test.rb
@@ -133,7 +133,17 @@ def test_reset_password
assert_not_equal old_salt, ben.password_salt
assert_not_equal old_persistence_token, ben.persistence_token
assert UserSession.find
+ end
+
+ def test_reset_password!
+ UserSession.create(users(:ben))
+ session = UserSession.find
+ assert session
+ ben = session.record
+ old_password = ben.crypted_password
+ old_salt = ben.password_salt
+ old_persistence_token = ben.persistence_token
ben.reset_password!
ben.reload
assert_not_equal old_password, ben.crypted_password
View
1  test/test_helper.rb
@@ -34,6 +34,7 @@
create_table :users do |t|
t.datetime :created_at
t.datetime :updated_at
+ t.integer :lock_version, :default => 0
t.integer :company_id
t.string :login
t.string :crypted_password

0 comments on commit 70ca165

Please sign in to comment.
Something went wrong with that request. Please try again.