Switch to more recent Laravel route definition methods

This commit is contained in:
DaneEveritt 2022-05-14 15:51:05 -04:00
parent 62b178ed02
commit 65f27d41a2
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
9 changed files with 278 additions and 308 deletions

View file

@ -2,9 +2,9 @@
namespace Pterodactyl\Http;
use Illuminate\Http\Middleware\TrustProxies;
use Pterodactyl\Models\ApiKey;
use Illuminate\Auth\Middleware\Authorize;
use Illuminate\Http\Middleware\TrustProxies;
use Illuminate\Auth\Middleware\Authenticate;
use Pterodactyl\Http\Middleware\TrimStrings;
use Illuminate\Session\Middleware\StartSession;
@ -72,21 +72,18 @@ class Kernel extends HttpKernel
IsValidJson::class,
StartSession::class,
AuthenticateSession::class,
VerifyCsrfToken::class,
],
'application-api' => [
ApiSubstituteBindings::class,
'api..key:' . ApiKey::TYPE_APPLICATION,
AuthenticateApplicationUser::class,
VerifyCsrfToken::class,
AuthenticateIPAccess::class,
],
'client-api' => [
HandleStatelessRequest::class,
IsValidJson::class,
StartSession::class,
AuthenticateSession::class,
SubstituteClientApiBindings::class,
'api..key:' . ApiKey::TYPE_ACCOUNT,
AuthenticateIPAccess::class,
VerifyCsrfToken::class,
// This is perhaps a little backwards with the Client API, but logically you'd be unable
// to create/get an API key without first enabling 2FA on the account, so I suppose in the
// end it makes sense.