Update demon routes to use /v1/

This commit is contained in:
Dane Everitt 2017-09-30 21:00:24 -05:00
parent 15d38ce823
commit b1834307d5
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
25 changed files with 55 additions and 67 deletions

View file

@ -30,6 +30,8 @@ use Illuminate\Contracts\Foundation\Application;
use Illuminate\Foundation\Testing\HttpException;
use League\Fractal\Serializer\JsonApiSerializer;
use Pterodactyl\Transformers\Daemon\ApiKeyTransformer;
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface;
class ValidateKeyController extends Controller
@ -81,7 +83,11 @@ class ValidateKeyController extends Controller
throw new HttpException(501);
}
$key = $this->daemonKeyRepository->getKeyWithServer($token);
try {
$key = $this->daemonKeyRepository->getKeyWithServer($token);
} catch (RecordNotFoundException $exception) {
throw new NotFoundHttpException;
}
return $this->fractal->item($key, $this->app->make(ApiKeyTransformer::class), 'server')
->serializeWith(JsonApiSerializer::class)