misc_pterodactyl-panel/app/Http/Middleware/Authenticate.php

27 lines
497 B
PHP
Raw Normal View History

<?php
namespace Pterodactyl\Http\Middleware;
use Closure;
2017-10-29 17:37:25 +00:00
use Illuminate\Http\Request;
2017-11-03 23:16:49 +00:00
use Illuminate\Auth\AuthenticationException;
class Authenticate
{
/**
* Handle an incoming request.
*
* @return mixed
2017-11-03 23:16:49 +00:00
*
* @throws \Illuminate\Auth\AuthenticationException
*/
2017-10-29 17:37:25 +00:00
public function handle(Request $request, Closure $next)
{
2021-01-23 20:33:34 +00:00
if (!$request->user()) {
throw new AuthenticationException();
}
return $next($request);
}
}