fix bug on jwt not updating
This commit is contained in:
parent
559bb6e12c
commit
bba893cdd4
6
utils.js
6
utils.js
|
@ -81,17 +81,13 @@ async function getClientToken() {
|
||||||
async function updateClientConfig(clientId, clientSecret, accessToken, tokenExpirationDate) {
|
async function updateClientConfig(clientId, clientSecret, accessToken, tokenExpirationDate) {
|
||||||
try {
|
try {
|
||||||
console.log('Updating the client config with the new token...');
|
console.log('Updating the client config with the new token...');
|
||||||
await models.clientConfig.findOrCreate({
|
await models.clientConfig.upsert({
|
||||||
where: {
|
|
||||||
id: 1,
|
id: 1,
|
||||||
},
|
|
||||||
defaults: {
|
|
||||||
clientId: clientId,
|
clientId: clientId,
|
||||||
clientSecret: clientSecret,
|
clientSecret: clientSecret,
|
||||||
currentToken: accessToken,
|
currentToken: accessToken,
|
||||||
tokenExpiration: tokenExpirationDate,
|
tokenExpiration: tokenExpirationDate,
|
||||||
requestLimit: 500,
|
requestLimit: 500,
|
||||||
},
|
|
||||||
});
|
});
|
||||||
console.log('Client config updated, new Token set');
|
console.log('Client config updated, new Token set');
|
||||||
console.log('New token expiration date: ', tokenExpirationDate);
|
console.log('New token expiration date: ', tokenExpirationDate);
|
||||||
|
|
Loading…
Reference in New Issue