getAuthPassword(); if ($this->isBcryptHash($hashed)) { if ($this->hasher->check($plain, $hashed)) { return true; } } else { if (md5($plain) === $hashed) { // Upgrade lĂȘn bcrypt $user->password = $this->hasher->make($plain); $user->save(); return true; } } return false; } protected function isBcryptHash($hashedPassword): bool { return password_get_info($hashedPassword)['algo'] === PASSWORD_BCRYPT; } }