1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-10-27 20:32:28 +01:00
Pterodactyl-Panel/app/Http/Middleware/Authenticate.php

29 lines
589 B
PHP
Raw Normal View History

<?php
namespace Pterodactyl\Http\Middleware;
use Closure;
2017-10-29 18:37:25 +01:00
use Illuminate\Http\Request;
2017-11-04 00:16:49 +01:00
use Illuminate\Auth\AuthenticationException;
class Authenticate
{
/**
* Handle an incoming request.
*
2017-08-22 05:10:48 +02:00
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
2017-11-04 00:16:49 +01:00
*
* @throws \Illuminate\Auth\AuthenticationException
*/
2017-10-29 18:37:25 +01:00
public function handle(Request $request, Closure $next)
{
2017-11-04 00:16:49 +01:00
if (! $request->user()) {
throw new AuthenticationException;
}
return $next($request);
}
}