mirror of
https://github.com/flarum/framework.git
synced 2025-01-31 23:16:16 +08:00
Fix password hashing
This commit is contained in:
parent
f9c839f0c6
commit
225a618713
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user