From feb969b908db3333d94ef342520fe341561040e6 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 29 Jun 2022 00:28:58 -0600 Subject: [PATCH] Update LiveStreamController, remove auth middleware from config endpoint --- app/Http/Controllers/LiveStreamController.php | 5 +---- routes/api.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/LiveStreamController.php b/app/Http/Controllers/LiveStreamController.php index 1aacb4ab3..0eea79626 100644 --- a/app/Http/Controllers/LiveStreamController.php +++ b/app/Http/Controllers/LiveStreamController.php @@ -336,11 +336,8 @@ class LiveStreamController extends Controller public function getConfig(Request $request) { - abort_if(!config('livestreaming.enabled'), 400); - abort_if(!$request->user(), 403); - $res = [ - 'enabled' => config('livestreaming.enabled'), + 'enabled' => (bool) config('livestreaming.enabled'), 'broadcast' => [ 'sources' => config('livestreaming.broadcast.sources'), 'limits' => config('livestreaming.broadcast.limits') diff --git a/routes/api.php b/routes/api.php index 3459a68e7..9ffcd9c49 100644 --- a/routes/api.php +++ b/routes/api.php @@ -110,7 +110,7 @@ Route::group(['prefix' => 'api'], function() use($middleware) { Route::post('chat/ban-user', 'LiveStreamController@banChatUser')->middleware($middleware); Route::post('chat/pin', 'LiveStreamController@pinChatComment')->middleware($middleware); Route::post('chat/unpin', 'LiveStreamController@unpinChatComment')->middleware($middleware); - Route::get('config', 'LiveStreamController@getConfig')->middleware($middleware); + Route::get('config', 'LiveStreamController@getConfig'); Route::post('broadcast/publish', 'LiveStreamController@clientBroadcastPublish'); Route::post('broadcast/finish', 'LiveStreamController@clientBroadcastFinish'); });