use hash_equals() to compare password hash

This commit is contained in:
printempw 2017-01-18 12:59:52 +08:00
parent 47c758c5c0
commit 4cfb3f27f6

View File

@ -80,7 +80,7 @@ class User extends Model
{
// compare directly if any responses is returned by event dispatcher
if ($result = static::getEncryptedPwdFromEvent($rawPasswd, $this)) {
return ($result == $this->password);
return hash_equals($this->password, $result);
}
return app('cipher')->verify($rawPasswd, $this->password, config('secure.salt'));