diff options
| author | winter | 2025-03-20 22:17:38 +0000 |
|---|---|---|
| committer | winter | 2025-03-20 22:17:38 +0000 |
| commit | b5c4e99cb1a2e5bb5cf6d38192d677843b1acd80 (patch) | |
| tree | 3aee1e8b4961abe6e8c6b84913b04c9396b11b4e /Digitigrade/Model | |
| parent | c10a1ea700a94e4eff8b10985cd402943ad07859 (diff) | |
fix various htmx navigation / page reloads
also i added a UserAccount::setPassword because i felt like it
Diffstat (limited to 'Digitigrade/Model')
| -rw-r--r-- | Digitigrade/Model/UserAccount.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Digitigrade/Model/UserAccount.php b/Digitigrade/Model/UserAccount.php index 37e0c7e..a409fe8 100644 --- a/Digitigrade/Model/UserAccount.php +++ b/Digitigrade/Model/UserAccount.php @@ -16,7 +16,7 @@ class UserAccount extends Model { public static function create(string $email, #[\SensitiveParameter] string $password): self { $user = new self(); $user->email = $email; - $user->passwordHash = defaults_password_hash($password); + $user->setPassword($password); $user->actor = null; $user->save(); return $user; @@ -69,6 +69,10 @@ class UserAccount extends Model { return password_verify($attemptedPassword, $this->passwordHash); } + public function setPassword(#[\SensitiveParameter] $newPassword): void { + $this->passwordHash = defaults_password_hash($newPassword); + } + /** * Throws if this user isn't an admin. * @return self this user (so you can use it in chains) |
