Skip to content

Commit ab5b93e

Browse files
author
vikasrohit
committed
Avoid reusing the global variable for client
It might be causing the caching of m2m token
1 parent 8ad7019 commit ab5b93e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/services/messageService.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ const tcCoreLibAuth = require('tc-core-library-js').auth;
77

88
const m2m = tcCoreLibAuth.m2m(config);
99

10-
let client = null;
1110

1211
/**
1312
* Get Http client to bus api
1413
* @param {Object} logger object
1514
* @return {Object} Http Client to bus api
1615
*/
1716
async function getClient(logger) {
18-
if (client) return client;
17+
let client = null;
1918
const msgApiUrl = config.get('messageApiUrl');
2019
try {
2120
const token = await m2m.getMachineToken(config.AUTH0_CLIENT_ID, config.AUTH0_CLIENT_SECRET);

0 commit comments

Comments
 (0)