Improve client API route model binding and prevent accidental route access without valid model binds
This commit is contained in:
parent
e1089e0b73
commit
4d1a7e6637
4 changed files with 119 additions and 39 deletions
|
@ -21,6 +21,7 @@ use Illuminate\View\Middleware\ShareErrorsFromSession;
|
|||
use Pterodactyl\Http\Middleware\MaintenanceMiddleware;
|
||||
use Pterodactyl\Http\Middleware\RedirectIfAuthenticated;
|
||||
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
|
||||
use Pterodactyl\Http\Middleware\Api\PreventUnboundModels;
|
||||
use Pterodactyl\Http\Middleware\Api\ApiSubstituteBindings;
|
||||
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
|
||||
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
||||
|
@ -76,6 +77,7 @@ class Kernel extends HttpKernel
|
|||
EnsureFrontendRequestsAreStateful::class,
|
||||
'auth:sanctum',
|
||||
SubstituteClientApiBindings::class,
|
||||
PreventUnboundModels::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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue