I'm using the React Stream Chat components and by default I'm getting all channels, even the ones the set user isn't a member of. This is how I set the user:
await client.setUser(
{
id: user.id.toString(),
name: user.name,
},
user.streamToken,
);
And this what the chat component looks like.
<Chat client={chatClient}>
<ChannelList />
<Channel>
<Window>
<MessageList />
<MessageInput />
</Window>
<Thread />
</Channel>
</Chat>
All Channels have been created with just two members and the documentation says:
You only need to specify the members if you want to limit access of this chat to these members and subscribe them to future updates
When logging the channels I can verify that I'm getting channels I'm not a member of. Is that the intended behavior or am I missing something?
There's a workaround by passing a filter to the ChannelList:
const filters = { members: { $in: [currentUser.id.toString()] } };
You probably have your permission checks turned off. You can enable them on the Stream Dashboard.
It's under "Disable Permissions Checks". Toggling this should activate the permission checks and show all the Channels that only you are a member of.
Still you'd want to keep the filter in your app.