mirror of
https://github.com/koel/koel
synced 2024-12-20 09:33:23 +00:00
18 lines
351 B
PHP
18 lines
351 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Middleware;
|
||
|
|
||
|
use Closure;
|
||
|
use Illuminate\Http\Request;
|
||
|
use Illuminate\Http\Response;
|
||
|
|
||
|
class AudioAuthenticate
|
||
|
{
|
||
|
public function handle(Request $request, Closure $next) // @phpcs:ignore
|
||
|
{
|
||
|
abort_unless($request->user()?->tokenCan('audio'), Response::HTTP_UNAUTHORIZED);
|
||
|
|
||
|
return $next($request);
|
||
|
}
|
||
|
}
|