Skip to content

Commit a9eadbe

Browse files
author
sachin-maheshwari
authored
Update helper.js
reverting my changes for excess call, fixing in core lib.
1 parent 4b1fb5a commit a9eadbe

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/common/helper.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22
const m2mAuth = require('tc-core-library-js').auth.m2m
33
const request = require('superagent')
44
const _ = require('lodash')
5-
var m2m = null
5+
const m2m = m2mAuth(_.pick(config, ['AUTH0_URL', 'AUTH0_AUDIENCE', 'TOKEN_CACHE_TIME', 'AUTH0_PROXY_SERVER_URL']))
66

77
/*
88
* Function to get M2M token
99
* @returns {Promise}
1010
*/
1111
const getM2Mtoken = async (config) => {
12-
if (_.isNull(m2m)) {
13-
m2m = m2mAuth(_.pick(config, ['AUTH0_URL', 'AUTH0_AUDIENCE', 'TOKEN_CACHE_TIME', 'AUTH0_PROXY_SERVER_URL']))
14-
}
1512
return m2m.getMachineToken(config.AUTH0_CLIENT_ID, config.AUTH0_CLIENT_SECRET)
1613
}
1714

0 commit comments

Comments
 (0)