it seems that the header in echo is missing
Echo.connector.pusher.config.auth.headers['Authorization'] = 'Bearer token';
You can check below link for further details. https://github.com/tlaverdure/laravel-echo-server/issues/129#issuecomment-284216291
@skynet-technologies i dont use pusher and problem is no request is sent to the '/api/auth/custom', with header or not
The above code was an example which means, we have to pass a header with authentication(using bearer) You can check the below code and implement your code within it.
window.Echo = new Echo({
broadcaster: 'socket.io',
host: HOST_FOR_YOUR_SERVER,
auth: {
headers: {
Authorization: 'Bearer ' + AUTH_API_TOKEN,
},
},
});
BroadcastServiceProvider:
Broadcast::routes(['middleware' => ['auth:api']]);
For more reference, you can check the below URL https://github.com/laravel/framework/issues/23268#issuecomment-443986055
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community