Download app/Http/Middleware/Authenticate.php from ken1402/myiptv: direct link, hf CLI and curl.
- Browser
- Download file 911 Bytes
-
https://huggingface.co/spaces/ken1402/myiptv/resolve/main/app/Http/Middleware/Authenticate.php
- Command line
-
hf download hf://spaces/ken1402/myiptv/app/Http/Middleware/Authenticate.php
-
curl -L -o Authenticate.php https://huggingface.co/spaces/ken1402/myiptv/resolve/main/app/Http/Middleware/Authenticate.php
911 Bytes
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Contracts\Auth\Factory as Auth; | |
| class Authenticate | |
| { | |
| /** | |
| * The authentication guard factory instance. | |
| * | |
| * @var \Illuminate\Contracts\Auth\Factory | |
| */ | |
| protected $auth; | |
| /** | |
| * Create a new middleware instance. | |
| * | |
| * @param \Illuminate\Contracts\Auth\Factory $auth | |
| * @return void | |
| */ | |
| public function __construct(Auth $auth) | |
| { | |
| $this->auth = $auth; | |
| } | |
| /** | |
| * Handle an incoming request. | |
| * | |
| * @param \Illuminate\Http\Request $request | |
| * @param \Closure $next | |
| * @param string|null $guard | |
| * @return mixed | |
| */ | |
| public function handle($request, Closure $next, $guard = null) | |
| { | |
| if ($this->auth->guard($guard)->guest()) { | |
| return response('Unauthorized.', 401); | |
| } | |
| return $next($request); | |
| } | |
| } | |