@open-rlb/ng-app 3.0.15 → 3.0.17

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 } from '@angular/router';
6
+ import { NavigationEnd, RoutesRecognized, RouterModule, Router, provideRouter, withDebugTracing } 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';
@@ -1326,13 +1326,20 @@ class AuthenticationService {
1326
1326
  currentProvider: authenticatedConfig.configId
1327
1327
  }));
1328
1328
  // Redirect logic -> clean query params
1329
- const redirect = this.cookiesService.getCookie('loginRedirectUrl');
1329
+ const redirect = localStorage.getItem('loginRedirectUrl');
1330
+ //const redirect = this.cookiesService.getCookie('loginRedirectUrl');
1330
1331
  this.logger.info(`Correct provider dispatched, redirectUrl: ${redirect}`);
1331
1332
  if (redirect) {
1332
- this.cookiesService.deleteCookie('loginRedirectUrl');
1333
- this.router.navigateByUrl(redirect, { replaceUrl: true });
1333
+ localStorage.removeItem('loginRedirectUrl');
1334
+ // this.cookiesService.deleteCookie('loginRedirectUrl');
1335
+ // setTimeout to prevent NavigationCancel
1336
+ // this allows current angular navigation cycle (handle URL with code/state) to complete
1337
+ setTimeout(() => {
1338
+ this.router.navigateByUrl(redirect, { replaceUrl: true });
1339
+ }, 0);
1334
1340
  }
1335
1341
  else {
1342
+ this.logger.info(`Correct provider dispatched, redirectUrl doesn't exist, navigate to root route: ${redirect}`);
1336
1343
  this.router.navigate([], {
1337
1344
  queryParams: {},
1338
1345
  replaceUrl: true,
@@ -1355,7 +1362,8 @@ class AuthenticationService {
1355
1362
  }
1356
1363
  login(targetUrl) {
1357
1364
  const returnUrl = targetUrl || this.router.url || '/';
1358
- this.cookiesService.setCookie('loginRedirectUrl', returnUrl, 1);
1365
+ // this.cookiesService.setCookie('loginRedirectUrl', returnUrl, 1);
1366
+ localStorage.setItem('loginRedirectUrl', returnUrl);
1359
1367
  this.logger.log(`call login method, loginRedirectUrl: ${returnUrl}`);
1360
1368
  // electron
1361
1369
  if (typeof (process) !== 'undefined' &&
@@ -3063,7 +3071,7 @@ function provideApp(app) {
3063
3071
  }, multi: true
3064
3072
  },];
3065
3073
  if (app.routes) {
3066
- providers.push(provideRouter(app.routes));
3074
+ providers.push(provideRouter(app.routes, withDebugTracing()));
3067
3075
  }
3068
3076
  if (app.providers) {
3069
3077
  providers.push(...app.providers);