How to set JWT later in app cycle


#1

I’m using Socket.io and JWT with my app and I followed the docs as noted here:
https://www.npmjs.com/package/ng-socket-io

So the importing and configuring is done in app.module.ts. For Socket.io and JWT looks like this for the config:

const config: SocketIoConfig = { url: 'https:/somedomain.com:88', options: { query: 'auth_token=XXXXXXXXXXSUPER_LONGXXXXXXX'  } };

The issue is I need to set the auth_token after a user has logged in and obviously this happens after the app.module.ts cycle. How can I later in the app set the auth_token?


#2

I still have not figured this out if anyone has some ideas.