Fix No application encryption key has been specified error while trying to generate said key

This commit is contained in:
Matthew Penner 2022-12-04 16:09:42 -07:00
parent 73b27aea8e
commit dd69652942
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View file

@ -2,12 +2,12 @@
namespace Pterodactyl\Providers; namespace Pterodactyl\Providers;
use View;
use Cache;
use Pterodactyl\Models; use Pterodactyl\Models;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Illuminate\Support\Facades\URL; use Illuminate\Support\Facades\URL;
use Illuminate\Pagination\Paginator; use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Pterodactyl\Extensions\Themes\Theme; use Pterodactyl\Extensions\Themes\Theme;

View file

@ -13,7 +13,7 @@ class NodeCreationService
/** /**
* NodeCreationService constructor. * NodeCreationService constructor.
*/ */
public function __construct(private Encrypter $encrypter, protected NodeRepositoryInterface $repository) public function __construct(protected NodeRepositoryInterface $repository)
{ {
} }
@ -25,7 +25,7 @@ class NodeCreationService
public function handle(array $data): Node public function handle(array $data): Node
{ {
$data['uuid'] = Uuid::uuid4()->toString(); $data['uuid'] = Uuid::uuid4()->toString();
$data['daemon_token'] = $this->encrypter->encrypt(Str::random(Node::DAEMON_TOKEN_LENGTH)); $data['daemon_token'] = app(Encrypter::class)->encrypt(Str::random(Node::DAEMON_TOKEN_LENGTH));
$data['daemon_token_id'] = Str::random(Node::DAEMON_TOKEN_ID_LENGTH); $data['daemon_token_id'] = Str::random(Node::DAEMON_TOKEN_ID_LENGTH);
return $this->repository->create($data, true, true); return $this->repository->create($data, true, true);