CakePHP - Auth哈希密码与Security :: hash()不同

Bad*_*sie 1 authentication passwords cakephp

在我的密码重置页面上,我使用Security :: hash()保存用户的新密码.然后,当我尝试登录时,我的数据库保存的哈希密码与在登录字段中对我的输入进行哈希处理时Auth出现的版本不匹配.

我假设这类似于Security :: hash(),使用我的应用程序盐来哈希密码,而Auth不使用那个盐?

你是怎么做到这一点的?

dei*_*zel 5

你尝试过这种AuthComponent::password()方法吗?

此外,如果该字段已命名password,请检查AuthComponent是否尚未对其进行哈希处理.


编辑:在3.x中,请参阅Hashing Passwords中的DefaultPasswordHasher::hash()说明.