fix(core.gbapp): #387 adding /setupSecurity multiple tokens. Refresh token fix. @othonlima @christopherdecastilho.

This commit is contained in:
Rodrigo Rodriguez 2023-12-28 10:32:47 -03:00
parent 03586868ec
commit c855934fdf
2 changed files with 10 additions and 5 deletions

View file

@ -543,8 +543,8 @@ export class GBVMService extends GBService {
// Transfers auto variables into global object.
for(i in this.variables) {
global[i] = this.variables[i];
for(__indexer in this.variables) {
global[__indexer] = this.variables[i];
}
@ -605,8 +605,8 @@ export class GBVMService extends GBService {
const ensureTokens = async (firstTime) => {
const tokens = this.tokens ? this.tokens.split(',') : [];
for(tokenIndexer in tokens) {
const tokenName = tokens[tokenIndexer];
for(__indexer in tokens) {
const tokenName = tokens[__indexer];
// Auto update Bearar authentication for the first token.
@ -623,7 +623,7 @@ export class GBVMService extends GBService {
global[tokenName + "_expiresOn"]= expiresOn;
}
if (tokenIndexer == 0) {
if (__indexer == 0) {
headers['Authorization'] = 'Bearer ' + global[tokenName];
}
}

View file

@ -2409,6 +2409,11 @@ export class SystemKeywords {
return table;
}
/**
* Publishs a tweet to X.
*
* TWEET "My tweet text"
*/
public async tweet({ pid, text }) {
const { min, user } = await DialogKeywords.getProcessInfo(pid);