@open-rlb/ng-app 3.0.18 → 3.0.19
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.
|
@@ -3,7 +3,7 @@ import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@a
|
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
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
|
-
import { NavigationEnd, RoutesRecognized, RouterModule, Router, provideRouter
|
|
6
|
+
import { NavigationEnd, RoutesRecognized, RouterModule, Router, provideRouter } from '@angular/router';
|
|
7
7
|
import * as i1$4 from '@angular/service-worker';
|
|
8
8
|
import { provideServiceWorker } from '@angular/service-worker';
|
|
9
9
|
import * as i1$8 from '@ngrx/effects';
|
|
@@ -1283,13 +1283,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
1283
1283
|
}] });
|
|
1284
1284
|
|
|
1285
1285
|
class AuthenticationService {
|
|
1286
|
-
constructor(oidcSecurityService, cookiesService, router, parseJwtService, store, log, envConfig, authConfig) {
|
|
1286
|
+
constructor(oidcSecurityService, cookiesService, router, parseJwtService, store, log, localStorage, envConfig, authConfig) {
|
|
1287
1287
|
this.oidcSecurityService = oidcSecurityService;
|
|
1288
1288
|
this.cookiesService = cookiesService;
|
|
1289
1289
|
this.router = router;
|
|
1290
1290
|
this.parseJwtService = parseJwtService;
|
|
1291
1291
|
this.store = store;
|
|
1292
1292
|
this.log = log;
|
|
1293
|
+
this.localStorage = localStorage;
|
|
1293
1294
|
this.envConfig = envConfig;
|
|
1294
1295
|
this.authConfig = authConfig;
|
|
1295
1296
|
this.logger = this.log.for(this.constructor.name);
|
|
@@ -1324,11 +1325,11 @@ class AuthenticationService {
|
|
|
1324
1325
|
this.store.dispatch(AuthActions.setCurrentProvider({
|
|
1325
1326
|
currentProvider: authenticatedConfig.configId
|
|
1326
1327
|
}));
|
|
1327
|
-
const redirect = localStorage.
|
|
1328
|
+
const redirect = this.localStorage.readLocal('loginRedirectUrl');
|
|
1328
1329
|
//const redirect = this.cookiesService.getCookie('loginRedirectUrl');
|
|
1329
1330
|
this.logger.info(`Correct provider dispatched, redirectUrl: ${redirect}`);
|
|
1330
1331
|
if (redirect) {
|
|
1331
|
-
localStorage.
|
|
1332
|
+
this.localStorage.removeLocal('loginRedirectUrl');
|
|
1332
1333
|
// this.cookiesService.deleteCookie('loginRedirectUrl');
|
|
1333
1334
|
// setTimeout to prevent NavigationCancel
|
|
1334
1335
|
// this allows current angular navigation cycle (handle URL with code/state) to complete
|
|
@@ -1361,7 +1362,7 @@ class AuthenticationService {
|
|
|
1361
1362
|
login(targetUrl) {
|
|
1362
1363
|
const returnUrl = targetUrl || this.router.url || '/';
|
|
1363
1364
|
// this.cookiesService.setCookie('loginRedirectUrl', returnUrl, 1);
|
|
1364
|
-
localStorage.
|
|
1365
|
+
this.localStorage.writeLocal('loginRedirectUrl', returnUrl);
|
|
1365
1366
|
this.logger.log(`call login method, loginRedirectUrl: ${returnUrl}`);
|
|
1366
1367
|
// electron
|
|
1367
1368
|
if (typeof (process) !== 'undefined' &&
|
|
@@ -1419,7 +1420,7 @@ class AuthenticationService {
|
|
|
1419
1420
|
matchRoles(roles) {
|
|
1420
1421
|
return this.accessToken$.pipe(map(token => this.parseJwtService.parseJwt(token)), map(payload => payload['roles']), map(userRoles => roles.some(role => userRoles.includes(role))));
|
|
1421
1422
|
}
|
|
1422
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthenticationService, deps: [{ token: i1$5.OidcSecurityService }, { token: CookiesService }, { token: i2.Router }, { token: ParseJwtService }, { token: i1$1.Store }, { token: AppLoggerService }, { token: RLB_CFG_ENV, optional: true }, { token: RLB_CFG_AUTH, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1423
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthenticationService, deps: [{ token: i1$5.OidcSecurityService }, { token: CookiesService }, { token: i2.Router }, { token: ParseJwtService }, { token: i1$1.Store }, { token: AppLoggerService }, { token: AppStorageService }, { token: RLB_CFG_ENV, optional: true }, { token: RLB_CFG_AUTH, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1423
1424
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthenticationService, providedIn: 'root' }); }
|
|
1424
1425
|
}
|
|
1425
1426
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthenticationService, decorators: [{
|
|
@@ -1427,7 +1428,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
1427
1428
|
args: [{
|
|
1428
1429
|
providedIn: 'root'
|
|
1429
1430
|
}]
|
|
1430
|
-
}], ctorParameters: () => [{ type: i1$5.OidcSecurityService }, { type: CookiesService }, { type: i2.Router }, { type: ParseJwtService }, { type: i1$1.Store }, { type: AppLoggerService }, { type: undefined, decorators: [{
|
|
1431
|
+
}], ctorParameters: () => [{ type: i1$5.OidcSecurityService }, { type: CookiesService }, { type: i2.Router }, { type: ParseJwtService }, { type: i1$1.Store }, { type: AppLoggerService }, { type: AppStorageService }, { type: undefined, decorators: [{
|
|
1431
1432
|
type: Optional
|
|
1432
1433
|
}, {
|
|
1433
1434
|
type: Inject,
|
|
@@ -3069,7 +3070,7 @@ function provideApp(app) {
|
|
|
3069
3070
|
}, multi: true
|
|
3070
3071
|
},];
|
|
3071
3072
|
if (app.routes) {
|
|
3072
|
-
providers.push(provideRouter(app.routes
|
|
3073
|
+
providers.push(provideRouter(app.routes));
|
|
3073
3074
|
}
|
|
3074
3075
|
if (app.providers) {
|
|
3075
3076
|
providers.push(...app.providers);
|