SocketCluster / socketcluster-client

JavaScript client for SocketCluster
MIT License
292 stars 91 forks source link

Add an event to check when the auth token is updated on the client #52

Closed jondubois closed 6 years ago

jondubois commented 8 years ago

There is no event to check when the auth token is updated on the client if the socket is already authenticated.

mauritslamers commented 8 years ago

I think it goes further. It doesn't seem like the information in the authToken is actually updated when it changes on the server. As it is a kind of shared session object, certain settings on the session are very useful on the client side, and having an updated version of that information saves a call to the server.

jondubois commented 8 years ago

@mauritslamers Yes, there was a bug there. Thanks for reporting. It has now been fixed in v4.3.19. Also a new authTokenChange event (different from authStateChange) was added so you can listen to token updates even if socket is already authenticated. I updated the website too http://socketcluster.io/#!/docs/api-scsocket-client