Fix test to run with new bootstrapping

This commit is contained in:
Dane Everitt 2018-03-04 22:42:33 -06:00
parent e8ea218f20
commit ac9f83a8fe
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 10 additions and 38 deletions

View file

@ -9,19 +9,14 @@
namespace Pterodactyl\Services\Helpers;
use Ramsey\Uuid\Uuid;
use Illuminate\Contracts\Hashing\Hasher;
use Illuminate\Database\ConnectionInterface;
use Illuminate\Contracts\Config\Repository as ConfigRepository;
class TemporaryPasswordService
{
const HMAC_ALGO = 'sha256';
/**
* @var \Illuminate\Contracts\Config\Repository
*/
protected $config;
/**
* @var \Illuminate\Database\ConnectionInterface
*/
@ -35,16 +30,11 @@ class TemporaryPasswordService
/**
* TemporaryPasswordService constructor.
*
* @param \Illuminate\Contracts\Config\Repository $config
* @param \Illuminate\Database\ConnectionInterface $connection
* @param \Illuminate\Contracts\Hashing\Hasher $hasher
*/
public function __construct(
ConfigRepository $config,
ConnectionInterface $connection,
Hasher $hasher
) {
$this->config = $config;
public function __construct(ConnectionInterface $connection, Hasher $hasher)
{
$this->connection = $connection;
$this->hasher = $hasher;
}
@ -57,7 +47,7 @@ class TemporaryPasswordService
*/
public function handle($email)
{
$token = hash_hmac(self::HMAC_ALGO, str_random(40), $this->config->get('app.key'));
$token = hash_hmac(self::HMAC_ALGO, Uuid::uuid4()->toString(), config('app.key'));
$this->connection->table('password_resets')->insert([
'email' => $email,