From 671fe0cc3e8a3a8cbc0f3f8675fe6c9d9d460b84 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Thu, 13 Jul 2023 14:13:48 -0300 Subject: [PATCH] fix(all): Minor changes in PROD. --- packages/admin.gbapp/services/GBAdminService.ts | 3 +++ packages/core.gbapp/services/GBSSR.ts | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/admin.gbapp/services/GBAdminService.ts b/packages/admin.gbapp/services/GBAdminService.ts index 1c04cb6a..ae96032f 100644 --- a/packages/admin.gbapp/services/GBAdminService.ts +++ b/packages/admin.gbapp/services/GBAdminService.ts @@ -1,3 +1,5 @@ + + /*****************************************************************************\ | ( )_ _ | | _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ | @@ -88,6 +90,7 @@ export class GBAdminService implements IGBAdminService { } public static async getADALCredentialsFromUsername(username: string, password: string) { + return await msRestAzure.loginWithUsernamePassword(username, password); } diff --git a/packages/core.gbapp/services/GBSSR.ts b/packages/core.gbapp/services/GBSSR.ts index b44a4422..487133d3 100644 --- a/packages/core.gbapp/services/GBSSR.ts +++ b/packages/core.gbapp/services/GBSSR.ts @@ -311,7 +311,8 @@ export class GBSSR { if (!Fs.existsSync(path)) { path = DialogKeywords.getGBAIPath(minBoot.botId, `gbui`); } - const url = req.url.replace(`/${botId}`, ''); + let parts = req.url.replace(`/${botId}`, '').split('?'); + let url = parts[0]; if (min && req.originalUrl && prerender && exclude) { @@ -335,12 +336,13 @@ export class GBSSR { if (GBServer.globals.wwwroot && url === '/') { path = GBServer.globals.wwwroot + "/index.html"; // TODO. } - if (!min) { + if (!min && !url.startsWith("/static")) { path = Path.join(GBServer.globals.wwwroot, url); } if (Fs.existsSync(path)) { if (min) { let html = Fs.readFileSync(path, 'utf8'); + html = html.replace(/\{p\}/gi, min.botId); html = html.replace(/\{botId\}/gi, min.botId); html = html.replace(/\{theme\}/gi, min.instance.theme ? min.instance.theme : 'default.gbtheme');