Path: blob/1.0-develop/app/Repositories/Wings/DaemonRevocationRepository.php
10279 views
<?php12namespace Pterodactyl\Repositories\Wings;34use GuzzleHttp\Exception\TransferException;5use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException;67class DaemonRevocationRepository extends DaemonRepository8{9/**10* Deauthorizes a user (disconnects websockets and SFTP) on the Wings instance for11* the provided servers. If no servers are provided, the user is deauthorized on all12* servers on the instance.13*14* @param string[] $servers15*/16public function deauthorize(string $user, array $servers = []): void17{18try {19$this->getHttpClient()->post('/api/deauthorize-user', [20'json' => ['user' => $user, 'servers' => $servers],21]);22} catch (TransferException $exception) {23throw new DaemonConnectionException($exception);24}25}26}272829