@osovitny/anatoly 3.20.19 → 3.20.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, EventEmitter, Component, Output, Input, Inject, Pipe, NgModule, Directive, ChangeDetectionStrategy, ViewChild, ViewEncapsulation, HostListener, HostBinding, provideAppInitializer, inject } from '@angular/core';
3
- import { BehaviorSubject, forkJoin, Subject, filter, takeUntil, map as map$1, catchError, of, merge, timer, fromEvent, firstValueFrom, lastValueFrom } from 'rxjs';
3
+ import { BehaviorSubject, forkJoin, Subject, filter, takeUntil, map as map$1, catchError, of, merge, timer, fromEvent, firstValueFrom } from 'rxjs';
4
4
  import { map, tap, mergeMap } from 'rxjs/operators';
5
5
  import * as i1 from '@angular/common/http';
6
6
  import { HttpResponse, HttpClient, HTTP_INTERCEPTORS, provideHttpClient } from '@angular/common/http';
@@ -1712,10 +1712,20 @@ class MSALRedirect {
1712
1712
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1713
1713
  </file>
1714
1714
  */
1715
- let msalSettings = document.getElementById("msalSettings").getAttribute('data-msalsettings');
1716
- let MSALConfig = JSON.parse(msalSettings);
1717
- let MSALApiConfig = MSALConfig?.api;
1718
- let MSALB2CConfig = MSALConfig?.b2c;
1715
+ //App
1716
+ function getMsalSettings() {
1717
+ const json = sessionStorage.getItem(SessionStorageKeys.appMSALSettings);
1718
+ return json ? JSON.parse(json) : null;
1719
+ }
1720
+ function resetMsalSettings() {
1721
+ let msalSettings = getMsalSettings();
1722
+ MSALConfig = msalSettings;
1723
+ MSALApiConfig = MSALConfig?.api;
1724
+ MSALB2CConfig = MSALConfig?.b2c;
1725
+ }
1726
+ let MSALConfig;
1727
+ let MSALApiConfig;
1728
+ let MSALB2CConfig;
1719
1729
 
1720
1730
  /*
1721
1731
  <file>
@@ -11235,6 +11245,7 @@ class AppService extends ApiServiceBase {
11235
11245
  sessionStorage.setItem(SessionStorageKeys.appCoreSettings, appCoreSettings);
11236
11246
  sessionStorage.setItem(SessionStorageKeys.appMSALSettings, appMSALSettings);
11237
11247
  resetAppCoreSettings();
11248
+ resetMsalSettings();
11238
11249
  }
11239
11250
  }));
11240
11251
  }
@@ -11275,7 +11286,7 @@ class AnatolyModule {
11275
11286
  provideHttpClient(),
11276
11287
  provideAppInitializer(() => {
11277
11288
  const appService = inject(AppService);
11278
- return lastValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
11289
+ return firstValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
11279
11290
  //Localization
11280
11291
  const translate = InjectorInstance.get(TranslateService);
11281
11292
  const localizationService = InjectorInstance.get(LocalizationService);
@@ -11284,9 +11295,9 @@ class AnatolyModule {
11284
11295
  //IAM
11285
11296
  const msalInstance = InjectorInstance.get(MsalService);
11286
11297
  const auth = InjectorInstance.get(AuthService);
11287
- msalInstance.initialize().pipe(map$1(() => {
11298
+ firstValueFrom(msalInstance.initialize()).then(() => {
11288
11299
  auth.init();
11289
- }));
11300
+ });
11290
11301
  })));
11291
11302
  }),
11292
11303
  AppService
@@ -11319,7 +11330,7 @@ class AnatolyModule {
11319
11330
  provideHttpClient(),
11320
11331
  provideAppInitializer(() => {
11321
11332
  const appService = inject(AppService);
11322
- return lastValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
11333
+ return firstValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
11323
11334
  //Localization
11324
11335
  const translate = InjectorInstance.get(TranslateService);
11325
11336
  const localizationService = InjectorInstance.get(LocalizationService);
@@ -11328,9 +11339,9 @@ class AnatolyModule {
11328
11339
  //IAM
11329
11340
  const msalInstance = InjectorInstance.get(MsalService);
11330
11341
  const auth = InjectorInstance.get(AuthService);
11331
- msalInstance.initialize().pipe(map$1(() => {
11342
+ firstValueFrom(msalInstance.initialize()).then(() => {
11332
11343
  auth.init();
11333
- }));
11344
+ });
11334
11345
  })));
11335
11346
  }),
11336
11347
  AppService