Files

24 lines
514 B
PHP
Raw Permalink Normal View History

2015-12-06 13:58:49 -05:00
<?php
2016-12-07 22:46:38 +00:00
2015-12-06 13:58:49 -05:00
namespace Pterodactyl\Http\Middleware;
2017-10-29 12:37:25 -05:00
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
2015-12-06 13:58:49 -05:00
class AdminAuthenticate
{
/**
* Handle an incoming request.
*
2024-10-21 19:18:20 -06:00
* @throws AccessDeniedHttpException
2015-12-06 13:58:49 -05:00
*/
2023-02-23 12:30:16 -07:00
public function handle(Request $request, \Closure $next): mixed
2015-12-06 13:58:49 -05:00
{
2021-01-23 12:33:34 -08:00
if (!$request->user() || !$request->user()->root_admin) {
throw new AccessDeniedHttpException();
2015-12-06 13:58:49 -05:00
}
return $next($request);
}
}