Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
connectionCallback: async (error) => {
if (error) {
logger.trace('[connectionCallback error] %j', error);
// error.message has to match what the server returns.
if ((error as any).message === 'TokenExpired') {
console.log('onTokenError about to call');
// Reset the WS connection for it to carry the new JWT.
(wsLink as any).subscriptionClient.close(false, false);
}
}
},
},