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

This commit is contained in:
Rodrigo Rodriguez 2023-12-28 08:21:16 -03:00
parent 84858db975
commit 03586868ec

View file

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