Skip to content

Commit 6d0d3d2

Browse files
committed
Add support for localhost development
1 parent 0ede192 commit 6d0d3d2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/portal-options/pm-request-context-provider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface RequestContext extends Record<string, any> {
99
organization: string;
1010
crdGatewayApiUrl?: string;
1111
isSubDomain: boolean;
12+
isLocalhost: boolean;
1213
}
1314

1415
@Injectable()
@@ -22,9 +23,8 @@ export class PMRequestContextProvider implements RequestContextProvider {
2223
...request.query,
2324
...(await this.pmPortalContextService.getContextValues(request)),
2425
organization,
25-
isSubDomain:
26-
request.hostname.includes('localhost') ||
27-
request.hostname !== baseDomain,
26+
isSubDomain: request.hostname !== baseDomain,
27+
isLocalhost: request.hostname.includes('localhost'),
2828
};
2929
}
3030
}

src/portal-options/service-providers/content-configuration-service-providers.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class ContentConfigurationServiceProvidersService
2424
throw new Error('Token is required');
2525
}
2626

27-
if (!context.isSubDomain) {
27+
if (!context.isSubDomain && !context.isLocalhost) {
2828
return welcomeNodeConfig;
2929
}
3030

src/portal-options/service-providers/kubernetes-service-providers.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class KubernetesServiceProvidersService
2424
throw new Error('Token is required');
2525
}
2626

27-
if (!context.isSubDomain) {
27+
if (!context.isSubDomain && !context.isLocalhost) {
2828
return welcomeNodeConfig;
2929
}
3030

0 commit comments

Comments
 (0)