1
0
mirror of https://github.com/flarum/core.git synced 2025-07-18 15:21:16 +02:00

Fix password hashing

This commit is contained in:
Toby Zerner
2015-02-26 13:29:36 +10:30
parent f3021e9a85
commit ed706540bf

View File

@@ -129,12 +129,23 @@ class User extends Model
*/
public function changePassword($password)
{
$this->password = $password ? static::$hasher->make($password) : null;
$this->password = $password;
$this->raise(new UserPasswordWasChanged($this));
return $this;
}
/**
* Store the password as a hash.
*
* @param string $value
*/
public function setPasswordAttribute($value)
{
$this->attributes['password'] = $value ? static::$hasher->make($value) : null;
}
/**
* Mark all discussions as read by setting the user's read_time.
*