From c4222eed717e94dd672df748b8272c2efc8ef547 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sat, 10 Mar 2018 17:02:44 +0100 Subject: [PATCH] Glad I caught that early on, oof. --- src/Users/User.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Users/User.php b/src/Users/User.php index fb9e6461..201ccf8a 100644 --- a/src/Users/User.php +++ b/src/Users/User.php @@ -94,12 +94,18 @@ class User extends Model 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)) { $this->password = $password; $this->save(); } - return password_verify($password, $this->password); + return true; } public function getDisplayRoleAttribute(?int $value): int