panel/app/Http/Middleware/AdminAuthenticate.php
Matthew Penner 8ca098940a
chore: update composer dependencies (#5198)
Signed-off-by: Matthew Penner <me@matthewp.io>
2024-10-21 19:18:20 -06:00

24 lines
514 B
PHP

<?php
namespace Pterodactyl\Http\Middleware;
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
class AdminAuthenticate
{
/**
* Handle an incoming request.
*
* @throws AccessDeniedHttpException
*/
public function handle(Request $request, \Closure $next): mixed
{
if (!$request->user() || !$request->user()->root_admin) {
throw new AccessDeniedHttpException();
}
return $next($request);
}
}