This repository has been archived on 2025-05-09. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Astral-nook/app/Http/Middleware/Authenticate.php
2021-01-23 12:33:34 -08:00

26 lines
497 B
PHP

<?php
namespace Pterodactyl\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Auth\AuthenticationException;
class Authenticate
{
/**
* Handle an incoming request.
*
* @return mixed
*
* @throws \Illuminate\Auth\AuthenticationException
*/
public function handle(Request $request, Closure $next)
{
if (!$request->user()) {
throw new AuthenticationException();
}
return $next($request);
}
}