mirror of
https://github.com/koel/koel
synced 2024-12-19 00:53:05 +00:00
17 lines
351 B
PHP
17 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);
|
|
}
|
|
}
|