Opekunov/laravel-centrifugo-broadcaster

Check compare with Centrifugo 4

Closed this issue · 2 comments

Check compare with Centrifugo 4

I was just reported an issue with private channel token generation. In v4 client claim is only used for backwards compatibility, instead sub claim with user ID must be part of subscription token. Details: https://centrifugal.dev/docs/getting-started/migration_v4#subscription-token-migration

I think the signature (and name) of generatePrivateChannelToken should be changed to sth like:

generateSubscriptionToken(string $userId, string $channel, $exp = 0, array $info = []): string

Or maybe:

generateSubscriptionToken(string $channel, string $userId = '',  $exp = 0, array $info = []): string

Hard to say which one is better.

Thx! Try this later 🙌