Skip to content

Commit

Permalink
fix(all): Minor changes in PROD.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Jul 13, 2023
1 parent b7f78d9 commit 671fe0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/admin.gbapp/services/GBAdminService.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


/*****************************************************************************\
| ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ |
Expand Down Expand Up @@ -88,6 +90,7 @@ export class GBAdminService implements IGBAdminService {
}

public static async getADALCredentialsFromUsername(username: string, password: string) {

return await msRestAzure.loginWithUsernamePassword(username, password);
}

Expand Down
6 changes: 4 additions & 2 deletions packages/core.gbapp/services/GBSSR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand All @@ -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');
Expand Down

0 comments on commit 671fe0c

Please sign in to comment.