Open Ashwin-Kapes opened 4 years ago
I'm trying to create a context inside axios response but it's not working. Here's my code:
function AuthToken(agent) { axios.post(URL HERE, PAYLOAD HERE) .then(function(response) { agent.context.set({ "name": 'token', "lifespan": 5, "parameters": { "access_token": response.data.access_token } }); return console.log(response); }) .catch(function(error) { return console.log(error); }); agent.add(`Hello`); }
I'm trying to create a context inside axios response but it's not working. Here's my code: