NoamB/sorcery — Issue #156: authenticate error 
Author: vkill
Created: 2011-11-23 14:14:58+00:00
State: open

```ruby
ruby-1.9.3-p0 :053 > user.change_password! 123456
(0.2ms) BEGIN
(0.7ms) SELECT 1 FROM "users" WHERE ("users"."username" = 'aaaaaaa' AND "users"."id" != 282) LIMIT 1
(0.9ms) UPDATE "users" SET "salt" = 'JqNaHAPvYUPgJqE9gSnL', "crypted_password" = '$2a$10$daHHg.xTXl3l9zzziGBk0OWd2PN3RTE.VNiEqwon3fmvWj/EEqbtO', "updated_at" = '2011-11-23 22:12:01.802860' WHERE "users"."id" = 282
(0.6ms) COMMIT
=> true
ruby-1.9.3-p0 :054 > user.reload
ruby-1.9.3-p0 :055 > User.authenticate user.email, 123456
User Load (1.2ms) SELECT "users".* FROM "users" WHERE (username = '122755990@qq.com' OR email = '122755990@qq.com') LIMIT 1
=> nil
ruby-1.9.3-p0 :057 > User.send :credentials_match?, user.crypted_password, 123456,user.salt
=> true
```

why ?