fix(core.gbapp): #387 adding /setupSecurity multiple tokens. Refresh token fix. @othonlima @christopherdecastilho.
This commit is contained in:
parent
84858db975
commit
03586868ec
1 changed files with 4 additions and 3 deletions
|
@ -605,8 +605,8 @@ export class GBVMService extends GBService {
|
||||||
const ensureTokens = async (firstTime) => {
|
const ensureTokens = async (firstTime) => {
|
||||||
const tokens = this.tokens ? this.tokens.split(',') : [];
|
const tokens = this.tokens ? this.tokens.split(',') : [];
|
||||||
|
|
||||||
for(i in tokens) {
|
for(tokenIndexer in tokens) {
|
||||||
const tokenName = tokens[i];
|
const tokenName = tokens[tokenIndexer];
|
||||||
|
|
||||||
// Auto update Bearar authentication for the first token.
|
// Auto update Bearar authentication for the first token.
|
||||||
|
|
||||||
|
@ -622,7 +622,8 @@ export class GBVMService extends GBService {
|
||||||
global[tokenName] = token;
|
global[tokenName] = token;
|
||||||
global[tokenName + "_expiresOn"]= expiresOn;
|
global[tokenName + "_expiresOn"]= expiresOn;
|
||||||
}
|
}
|
||||||
if (i == 0) {
|
|
||||||
|
if (tokenIndexer == 0) {
|
||||||
headers['Authorization'] = 'Bearer ' + global[tokenName];
|
headers['Authorization'] = 'Bearer ' + global[tokenName];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue