How to logout user from pusher

73 views Asked by At

I have a single page application with a single pusher instance.

This pusher instance is being subscribed to 3 channels:

  • broadcast (public channel available for everyone)
  • user-1 (private channel available only to user with id 1)
  • article-123 (public channel since user is currently browsing article with id 123)

I did this running following commands:

pusher.signin();
pusher.subscribe('broadcast').bind(...);
pusher.subscribe('private-user-1').bind(...);
pusher.subscribe('article-123').bind(...);

Now user clicks logout button and then logins into another account.
I can easily do:

pusher.unsubscribe('private-user-1');
pusher.subscribe('private-user-2').bind(...);

but what about signin()?
How can I tell pusher that the user changed without leaving the other two channels?
I dont see a signout() function in the API.

0

There are 0 answers