Glad I caught that early on, oof.
This commit is contained in:
parent
25ac3e4bac
commit
c4222eed71
1 changed files with 7 additions and 1 deletions
|
@ -94,12 +94,18 @@ class User extends Model
|
||||||
|
|
||||||
public function validatePassword(string $password): bool
|
public function validatePassword(string $password): bool
|
||||||
{
|
{
|
||||||
|
$verification = password_verify($password, $this->password);
|
||||||
|
|
||||||
|
if ($verification !== true) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (password_needs_rehash($this->password, self::PASSWORD_HASH_ALGO)) {
|
if (password_needs_rehash($this->password, self::PASSWORD_HASH_ALGO)) {
|
||||||
$this->password = $password;
|
$this->password = $password;
|
||||||
$this->save();
|
$this->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
return password_verify($password, $this->password);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDisplayRoleAttribute(?int $value): int
|
public function getDisplayRoleAttribute(?int $value): int
|
||||||
|
|
Loading…
Add table
Reference in a new issue