File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 33 AuthConfigService ,
44 DiscoveryService ,
55 EnvAuthConfigService ,
6+ EnvService ,
67 ServerAuthVariables ,
78} from '@openmfp/portal-server-lib' ;
89import type { Request } from 'express' ;
@@ -14,6 +15,7 @@ export class PMAuthConfigProvider implements AuthConfigService {
1415 constructor (
1516 private discoveryService : DiscoveryService ,
1617 private envEuthConfigService : EnvAuthConfigService ,
18+ private envService : EnvService ,
1719 ) { }
1820
1921 async getAuthConfig ( request : Request ) : Promise < ServerAuthVariables > {
@@ -75,6 +77,15 @@ export class PMAuthConfigProvider implements AuthConfigService {
7577 const subDomain = request . hostname . split ( '.' ) [ 0 ] ;
7678 const clientId = process . env [ 'OIDC_CLIENT_ID_DEFAULT' ] ;
7779 const baseDomain = process . env [ 'BASE_DOMAINS_DEFAULT' ] ;
80+
81+ const { isLocal } = this . envService . getEnv ( ) ;
82+ if ( isLocal ) {
83+ return {
84+ organization : 'openmfp' ,
85+ baseDomain : request . hostname ,
86+ } ;
87+ }
88+
7889 return {
7990 organization : request . hostname === baseDomain ? clientId : subDomain ,
8091 baseDomain,
Original file line number Diff line number Diff line change @@ -2,16 +2,21 @@ import { RequestContext } from '../openmfp-request-context-provider.js';
22import { contentConfigurationsQuery } from './contentconfigurations-query.js' ;
33import { ContentConfigurationQueryResponse } from './models/contentconfigurations.js' ;
44import { welcomeNodeConfig } from './models/welcome-node-config.js' ;
5+ import { Injectable } from '@nestjs/common' ;
56import {
67 ContentConfiguration ,
8+ EnvService ,
79 ServiceProviderResponse ,
810 ServiceProviderService ,
911} from '@openmfp/portal-server-lib' ;
1012import { GraphQLClient } from 'graphql-request' ;
1113
14+ @Injectable ( )
1215export class ContentConfigurationServiceProvidersService
1316 implements ServiceProviderService
1417{
18+ constructor ( private envService : EnvService ) { }
19+
1520 async getServiceProviders (
1621 token : string ,
1722 entities : string [ ] ,
@@ -22,7 +27,8 @@ export class ContentConfigurationServiceProvidersService
2227 throw new Error ( 'Token is required' ) ;
2328 }
2429
25- if ( ! context . isSubDomain ) {
30+ const { isLocal } = this . envService . getEnv ( ) ;
31+ if ( ! context . isSubDomain && ! isLocal ) {
2632 return welcomeNodeConfig ;
2733 }
2834
You can’t perform that action at this time.
0 commit comments