service(NodeJWTService): fix usage of deprecated parameters

This commit is contained in:
Matthew Penner
2021-01-15 18:45:01 -07:00
parent 94653c0a78
commit 130c63a181
7 changed files with 27 additions and 24 deletions

View File

@@ -2,8 +2,8 @@
namespace Pterodactyl\Http\Controllers\Api\Remote\Servers;
use Cake\Chronos\Chronos;
use Illuminate\Support\Arr;
use Carbon\CarbonImmutable;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Http\JsonResponse;
@@ -110,11 +110,11 @@ class ServerTransferController extends Controller
Arr::set($data, 'suspended', false);
$this->connection->transaction(function () use ($data, $server) {
// This token is used by the new node the server is being transfered to. It allows
// This token is used by the new node the server is being transferred to. It allows
// that node to communicate with the old node during the process to initiate the
// actual file transfer.
$token = $this->jwtService
->setExpiresAt(Chronos::now()->addMinutes(15))
->setExpiresAt(CarbonImmutable::now()->addMinutes(15)->toDateTimeImmutable())
->setSubject($server->uuid)
->handle($server->node, $server->uuid, 'sha256');
@@ -128,7 +128,7 @@ class ServerTransferController extends Controller
$this->daemonTransferRepository
->setServer($server)
->setNode($server->transfer->newNode)
->notify($server, $data, $server->node, $token->__toString());
->notify($server, $data, $server->node, $token->toString());
});
return new JsonResponse([], Response::HTTP_NO_CONTENT);