@open-rlb/ng-app 3.0.7 → 3.0.9

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,7 +1,7 @@
1
1
  import * as i1$3 from '@angular/common/http';
2
2
  import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
3
3
  import * as i0 from '@angular/core';
4
- import { InjectionToken, Injectable, Inject, Optional, EventEmitter, importProvidersFrom, makeStateKey, makeEnvironmentProviders, Pipe, Input, Component, PLATFORM_ID, NgModule, Directive, inject, isDevMode } from '@angular/core';
4
+ import { InjectionToken, Injectable, Inject, Optional, EventEmitter, importProvidersFrom, makeStateKey, makeEnvironmentProviders, Pipe, Input, Component, PLATFORM_ID, NgModule, Directive, inject, APP_INITIALIZER, isDevMode } from '@angular/core';
5
5
  import * as i2 from '@angular/router';
6
6
  import { NavigationEnd, RoutesRecognized, RouterModule, Router, provideRouter } from '@angular/router';
7
7
  import * as i1$4 from '@angular/service-worker';
@@ -446,6 +446,11 @@ class AppsService {
446
446
  this.store.dispatch(AppContextActions.setCurrentApp({ app, mode: viewMode, url }));
447
447
  }
448
448
  initAuthProviders(store, confAuth) {
449
+ const currentProviderInStore = this.store.selectSignal((state) => state[authsFeatureKey].currentProvider)();
450
+ if (currentProviderInStore) {
451
+ this.logger.info(`Auth provider already set to '${currentProviderInStore}' by Initializer. AppsService initAuthProviders skipping init.`);
452
+ return;
453
+ }
449
454
  if (!confAuth?.providers?.length) {
450
455
  this.logger.warn('No auth providers configured.');
451
456
  return;
@@ -2849,10 +2854,10 @@ class AuthEffects {
2849
2854
  return this.actions$.pipe(ofType(AuthActions.setCurrentProvider), map$1(({ currentProvider }) => AuthActionsInternal.setCurrentProvider({ currentProvider })));
2850
2855
  });
2851
2856
  this.logger = this.loggerService.for(this.constructor.name);
2852
- this.logger.log('Initialized AuthEffects');
2853
- if (authConfig) {
2854
- auth.checkAuthMultiple().subscribe();
2855
- }
2857
+ this.logger.log(`Initialized AuthEffects, auth config: ${authConfig}`);
2858
+ // if (authConfig) {
2859
+ // auth.checkAuthMultiple().subscribe();
2860
+ // }
2856
2861
  }
2857
2862
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthEffects, deps: [{ token: i1$8.Actions }, { token: AuthenticationService }, { token: AppLoggerService }, { token: RLB_CFG_AUTH, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2858
2863
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthEffects }); }
@@ -2963,6 +2968,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
2963
2968
  }]
2964
2969
  }] });
2965
2970
 
2971
+ function authInitializer(authService) {
2972
+ console.warn("authInitializer!!");
2973
+ return () => authService.checkAuthMultiple();
2974
+ }
2975
+
2966
2976
  const verifyDeactivate = (component, currentRoute, currentState, nextState) => {
2967
2977
  return component.verifyDeactivate();
2968
2978
  };
@@ -3008,6 +3018,12 @@ function provideRlbConfig(env) {
3008
3018
  },
3009
3019
  multi: true,
3010
3020
  },
3021
+ {
3022
+ provide: APP_INITIALIZER,
3023
+ useFactory: authInitializer,
3024
+ deps: [AuthenticationService],
3025
+ multi: true
3026
+ },
3011
3027
  ];
3012
3028
  }
3013
3029
  function provideApp(app) {