mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
Add Pusher auth endpoint
This commit is contained in:
parent
bf1885f8ef
commit
7780036a74
1 changed files with 16 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Broadcasting\Broadcasters\PusherBroadcaster;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
Route::group(['namespace' => 'API'], function () {
|
||||
Route::post('me', 'AuthController@login');
|
||||
Route::delete('me', 'AuthController@logout');
|
||||
|
@ -9,6 +12,19 @@ Route::group(['namespace' => 'API'], function () {
|
|||
// Just acting as a ping service.
|
||||
});
|
||||
|
||||
Route::post('broadcasting/auth', function (Request $request) {
|
||||
$pusher = new Pusher(
|
||||
config('broadcasting.connections.pusher.key'),
|
||||
config('broadcasting.connections.pusher.secret'),
|
||||
config('broadcasting.connections.pusher.app_id'),
|
||||
[
|
||||
'cluster' => config('broadcasting.connections.pusher.options.cluster'),
|
||||
'encrypted' => true,
|
||||
]
|
||||
);
|
||||
return $pusher->socket_auth($request->channel_name, $request->socket_id);
|
||||
});
|
||||
|
||||
Route::get('data', 'DataController@index');
|
||||
|
||||
Route::post('settings', 'SettingController@store');
|
||||
|
|
Loading…
Reference in a new issue