fix(core.gbapp): #387 adding /setupSecurity multiple tokens. Refresh token fix. @othonlima.
This commit is contained in:
parent
2f29287a96
commit
efa5e0fd03
2 changed files with 4 additions and 5 deletions
|
@ -605,7 +605,7 @@ export class GBVMService extends GBService {
|
||||||
const ensureTokens = async () => {
|
const ensureTokens = async () => {
|
||||||
const tokens = this.tokens ? this.tokens.split(',') : [];
|
const tokens = this.tokens ? this.tokens.split(',') : [];
|
||||||
|
|
||||||
for(tokenName in tokens) {
|
for(i in tokens) {
|
||||||
const expiresOn = new Date(global[tokenName + "_expiresOn"]);
|
const expiresOn = new Date(global[tokenName + "_expiresOn"]);
|
||||||
|
|
||||||
if (expiresOn.getTime() > new Date().getTime()) {
|
if (expiresOn.getTime() > new Date().getTime()) {
|
||||||
|
@ -619,8 +619,7 @@ export class GBVMService extends GBService {
|
||||||
};
|
};
|
||||||
|
|
||||||
try{
|
try{
|
||||||
await ensureTokens();
|
${code} // ISSUE: #339, tabify this.
|
||||||
${code}
|
|
||||||
}
|
}
|
||||||
catch(e){
|
catch(e){
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
@ -959,7 +958,7 @@ export class GBVMService extends GBService {
|
||||||
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
variables[t] = 'ERROR: Configure /setupSecurity before using token variables.';
|
variables[t] = `${error}: Configure /setupSecurity before using token variables.`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1683,7 +1683,7 @@ export class SystemKeywords {
|
||||||
min.core.getParam(min.instance, `${tokenName} Host`, null),
|
min.core.getParam(min.instance, `${tokenName} Host`, null),
|
||||||
min.core.getParam(min.instance, `${tokenName} Tenant`, null)
|
min.core.getParam(min.instance, `${tokenName} Tenant`, null)
|
||||||
);
|
);
|
||||||
const expiresOn = await min.adminService.getValue(min.instanceId, `${tokenName}expiresOn`);
|
const expiresOn = await min.adminService.getValue(min.instance.instanceId, `${tokenName}expiresOn`);
|
||||||
|
|
||||||
return { token, expiresOn };
|
return { token, expiresOn };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue