Logging changes
This commit is contained in:
parent
7be0fdfe3c
commit
bb1d88b647
6
index.js
6
index.js
|
@ -47,11 +47,13 @@ async function getClientToken() {
|
|||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
body: `grant_type=client_credentials&client_id=${clientId}&client_secret=${clientSecret}&scope=role:app catalog:read organization:read`,
|
||||
body: `grant_type=client_credentials&client_id=${clientId}&client_secret=${clientSecret}&scope=role:app catalog:read supply:read organization:read network:read`,
|
||||
});
|
||||
|
||||
const tokenResponse = await tokenRequest.json();
|
||||
|
||||
console.log("Token response: ", tokenResponse);
|
||||
|
||||
const accessToken = tokenResponse.access_token;
|
||||
let now = moment().format("YYYY-MM-DD HH:mm:ss");
|
||||
|
||||
|
@ -80,6 +82,8 @@ async function updateClientConfig(
|
|||
tokenExpirationDate
|
||||
) {
|
||||
try {
|
||||
|
||||
console.log("Updating the client config with the new token...");
|
||||
await models.clientConfig.update(
|
||||
{
|
||||
clientId: clientId,
|
||||
|
|
Loading…
Reference in New Issue