@@ -14,15 +14,13 @@ import {
1414 APP_CONFIG ,
1515 APP_CONFIG_STATE ,
1616 AppConfig ,
17+ toClientConfig ,
1718} from '@dspace/config/app-config.interface' ;
1819import { BuildConfig } from '@dspace/config/build-config.interface' ;
1920import { CorrelationIdService } from '@dspace/core/correlation-id/correlation-id.service' ;
2021import { LocaleService } from '@dspace/core/locale/locale.service' ;
2122import { HeadTagService } from '@dspace/core/metadata/head-tag.service' ;
22- import {
23- isEmpty ,
24- isNotEmpty ,
25- } from '@dspace/shared/utils/empty.util' ;
23+ import { isEmpty } from '@dspace/shared/utils/empty.util' ;
2624import { Store } from '@ngrx/store' ;
2725import { TranslateService } from '@ngx-translate/core' ;
2826import { lastValueFrom } from 'rxjs' ;
@@ -117,14 +115,9 @@ export class ServerInitService extends InitService {
117115 }
118116
119117 private saveAppConfigForCSR ( ) : void {
120- if ( isNotEmpty ( environment . rest . ssrBaseUrl ) && environment . rest . baseUrl !== environment . rest . ssrBaseUrl ) {
121- // Avoid to transfer ssrBaseUrl in order to prevent security issues
122- const config : AppConfig = Object . assign ( { } , environment as AppConfig , {
123- rest : Object . assign ( { } , environment . rest , { ssrBaseUrl : '' , hasSsrBaseUrl : true } ) ,
124- } ) ;
125- this . transferState . set < AppConfig > ( APP_CONFIG_STATE , config ) ;
126- } else {
127- this . transferState . set < AppConfig > ( APP_CONFIG_STATE , environment as AppConfig ) ;
128- }
118+ this . transferState . set < AppConfig > (
119+ APP_CONFIG_STATE ,
120+ toClientConfig ( environment as AppConfig ) as AppConfig ,
121+ ) ;
129122 }
130123}
0 commit comments