mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-23 09:32:29 +01:00
27 lines
497 B
PHP
27 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);
|
|
}
|
|
}
|