From 0fe2bdbe6fa3cc30355acbadab38747e800e050b Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Wed, 26 Jul 2023 15:05:53 -0300 Subject: [PATCH] fix(core.gbapp): FIX SSR errors and setOption impersonated. --- packages/core.gbapp/services/GBDeployer.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/packages/core.gbapp/services/GBDeployer.ts b/packages/core.gbapp/services/GBDeployer.ts index d11e81d7b..b3726f76a 100644 --- a/packages/core.gbapp/services/GBDeployer.ts +++ b/packages/core.gbapp/services/GBDeployer.ts @@ -203,12 +203,14 @@ export class GBDeployer implements IGBDeployer { * Deploys a new blank bot to the database, cognitive services and other services. */ public async deployBlankBot(botId: string, mobile: string, email: string) { + // Creates a new row on the GuaribasInstance table. const instance = await this.importer.createBotInstance(botId); const bootInstance = GBServer.globals.bootInstance; // Gets the access token to perform service operations. + const accessToken = await (GBServer.globals.minBoot.adminService as any)['acquireElevatedToken'] (bootInstance.instanceId, true); @@ -276,22 +278,6 @@ export class GBDeployer implements IGBDeployer { ); } else { const botId = GBConfigService.get('BOT_ID'); - const bootInstance = await this.core.loadInstanceByBotId(botId); - - instance.searchHost = bootInstance.searchHost; - instance.searchIndex = bootInstance.searchIndex; - instance.searchIndexer = bootInstance.searchIndexer; - instance.searchKey = bootInstance.searchKey; - instance.whatsappServiceKey = bootInstance.whatsappServiceKey; - instance.whatsappServiceNumber = bootInstance.whatsappServiceNumber; - instance.whatsappServiceUrl = bootInstance.whatsappServiceUrl; - instance.storageServer = bootInstance.storageServer; - instance.storageName = bootInstance.storageName; - instance.storageUsername = bootInstance.storageUsername; - instance.storagePassword = bootInstance.storagePassword; - instance.cloudLocation = bootInstance.cloudLocation; - instance.speechEndpoint = bootInstance.speechEndpoint; - instance.speechKey = bootInstance.speechKey; // Internally create resources on cloud provider.