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

This commit is contained in:
Rodrigo Rodriguez 2023-12-25 18:42:23 -03:00
parent c6076c32ef
commit 255a10bdc3
2 changed files with 5 additions and 4 deletions

View file

@ -620,6 +620,7 @@ export class GBVMService extends GBService {
}; };
try{ try{
await ensureTokens();
${code} ${code}
} }
catch(e){ catch(e){
@ -954,8 +955,8 @@ export class GBVMService extends GBService {
try { try {
let {token, expiresOn} = await sys.getCustomToken({pid, tokenName}); let {token, expiresOn} = await sys.getCustomToken({pid, tokenName});
variables[token] = token; variables[tokenName] = token;
variables[token + '_expiresOn'] = expiresOn; variables[tokenName + '_expiresOn'] = expiresOn;
} catch (error) { } catch (error) {

View file

@ -1670,10 +1670,10 @@ export class SystemKeywords {
return res; return res;
} }
public async getCustomToken({ pid, token: tokenName }) { public async getCustomToken({ pid, tokenName }) {
const { min } = await DialogKeywords.getProcessInfo(pid); const { min } = await DialogKeywords.getProcessInfo(pid);
GBLogEx.info(min, `GET TOKEN: ${tokenName}`); GBLogEx.info(min, `BASIC internal getCustomToken: ${tokenName}`);
const token = await (min.adminService as any)['acquireElevatedToken'] const token = await (min.adminService as any)['acquireElevatedToken']
(min.instance.instanceId, false, (min.instance.instanceId, false,