ng2-signalr
ng2-signalr copied to clipboard
Possibility to modify qs after connection is started
Hi,
I've implemented authorization by passing access token through the query string param. But I also need a possibility to replace that token once it gets updated.
For now I'm able to achieve that by doing something veeery horrible:
(<any>this.connection)._jConnection.qs["access_token"] = token;
It would be nice to be able to do it in typescript-ish way :)
I think you need to pass in IConnectionOptions to the connect method. something like Signalr.connect({ qs: {blabla : 'fff' }}); But this has the drawback of creating a new connection.
Do you mean changing the qs on a existing connection ? Indeed. Good feedback. Will add that in future versions...
Wouldn't it restart existing connection?
I'm doing
Signalr.connect({ qs: {access_token: 'here goes token' }});
when connecting for the first time, but then I need to change query string some time after that, when access token is refreshed.
any update?
@HNeukermans, is any update on this? We need to update hub's access token on token refresh