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

29 lines
573 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.
*
2017-08-22 03:10:48 +00:00
* @param \Illuminate\Http\Request $request
2019-09-06 04:32:57 +00:00
* @param \Closure $next
* @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)
{
2017-11-03 23:16:49 +00:00
if (! $request->user()) {
throw new AuthenticationException;
}
return $next($request);
}
}