Attach a scope(s) to JWTs created by the panel (#5636)

Necessary for proper token identification on Wings.
This commit is contained in:
Dane Everitt
2026-05-23 11:15:36 -07:00
committed by GitHub
parent 3cabff156e
commit 7ffcd63631
10 changed files with 115 additions and 22 deletions
@@ -4,6 +4,7 @@ namespace Pterodactyl\Http\Controllers\Admin\Servers;
use Carbon\CarbonImmutable;
use Illuminate\Http\Request;
use Pterodactyl\Enum\JwtScope;
use Pterodactyl\Models\Server;
use Illuminate\Http\RedirectResponse;
use Prologue\Alerts\AlertsMessageBag;
@@ -78,7 +79,8 @@ class ServerTransferController extends Controller
$token = $this->nodeJWTService
->setExpiresAt(CarbonImmutable::now()->addMinutes(15))
->setSubject($server->uuid)
->handle($transfer->newNode, $server->uuid, 'sha256');
->setScopes(JwtScope::ServerTransfer)
->handle($transfer->newNode, $server->uuid);
// Notify the source node of the pending outgoing transfer.
$this->daemonTransferRepository->setServer($server)->notify($transfer->newNode, $token);