Angularjs Socketio + JWT Token; connecting but not emitting after logout

Hi guys,

I’m using socketio with a jwt token for authentication.

It works very well most of the time; connecting, emitting/receiving events etc; except when I logout + close the app/ionic browser window.

I get the token from an http call and store it to the localStorage.

After I logout and close the app/browser, I restart the app/browser, log in, get a token, store it to localStorage; but then, the socket is connecting but not emitting events unless I refresh the page.

The same problem happens when I use promises as explained here.

https://github.com/btford/angular-socket-io/issues/76

Anyone came accross that before?

So if the user never logs out he’s fine… but otherwise he’ll never be able to

1 Like