parent
fb2909a1c7
commit
6409fffdad
22 changed files with 143 additions and 166 deletions
|
@ -12,9 +12,9 @@ namespace Pterodactyl\Http\Middleware\Server;
|
|||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\Session\Session;
|
||||
use Illuminate\Auth\AuthenticationException;
|
||||
use Pterodactyl\Services\DaemonKeys\DaemonKeyProviderService;
|
||||
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
|
||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||
|
||||
class AuthenticateAsSubuser
|
||||
{
|
||||
|
@ -56,9 +56,9 @@ class AuthenticateAsSubuser
|
|||
$server = $request->attributes->get('server');
|
||||
|
||||
try {
|
||||
$token = $this->keyProviderService->handle($server->id, $request->user()->id);
|
||||
$token = $this->keyProviderService->handle($server, $request->user());
|
||||
} catch (RecordNotFoundException $exception) {
|
||||
throw new AuthenticationException('This account does not have permission to access this server.');
|
||||
throw new AccessDeniedHttpException('This account does not have permission to access this server.');
|
||||
}
|
||||
|
||||
$this->session->now('server_data.token', $token);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue