fix checking user password returned by event listeners

This commit is contained in:
printempw 2016-11-05 21:23:07 +08:00
parent 821cd025e9
commit 1ee3ecd462

View File

@ -73,10 +73,12 @@ class User extends Model
$responses = event(new EncryptUserPassword($raw_passwd, $this));
if (isset($responses[0])) {
$this->password = $responses[0];
$encrypted = $responses[0];
} else {
$encrypted = app('cipher')->encrypt($raw_passwd, config('secure.salt'));
}
return (app('cipher')->encrypt($raw_passwd, config('secure.salt')) == $this->password);
return ($encrypted == $this->password);
}
/**