I have laravel 11.x and tenancyforlaravel 3.8 with subdomains, I have there to implement broadcasting for private channel but the user is not recognized, I assume the tenant is not detected correctly. I get in console /broadcasting/auth 403 (Forbidden)
Through deep debugging I came to the following path /vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster::auth()
and $this->retrieveUser($request, $channelName)
returns null
, in the non tenancy project I got User
object.
In: BroadcastServiceProvider
I tried to add several middleware options but without success:
Broadcast::routes(['middleware' => [InitializeTenancyByDomainOrSubdomain::class,PreventAccessFromCentralDomains::class]]);
Broadcast::routes(['middleware' => ['auth']]);
Of course I checked stackoverflow and other sources but my issue is related only to tenancyforlaravel implementation.
Is anyone aware how to handle authenticated users for private channels with tenancyforlaravel?