@open-rlb/ng-app 3.0.11 → 3.0.13

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.
@@ -156,10 +156,9 @@ const LEVEL_PRIORITIES = {
156
156
  debug: 4,
157
157
  log: 5,
158
158
  };
159
- class AppLoggerService extends AbstractLoggerService {
159
+ class AppLoggerService {
160
160
  constructor() {
161
- super();
162
- this.currentLevel = 'off';
161
+ this.currentLevel = 'log';
163
162
  this.timestamps = true;
164
163
  }
165
164
  setLogLevel(level) {
@@ -1327,7 +1326,7 @@ class AuthenticationService {
1327
1326
  this.logger.info(`Correct provider dispatched, redirectUrl: ${redirect}`);
1328
1327
  if (redirect) {
1329
1328
  this.cookiesService.deleteCookie('loginRedirectUrl');
1330
- this.router.navigate([redirect], { queryParams: {} });
1329
+ this.router.navigateByUrl(redirect, { replaceUrl: true });
1331
1330
  }
1332
1331
  else {
1333
1332
  this.router.navigate([], {
@@ -1350,9 +1349,10 @@ class AuthenticationService {
1350
1349
  }));
1351
1350
  //}
1352
1351
  }
1353
- login() {
1354
- this.cookiesService.setCookie('loginRedirectUrl', this.router.url || '/', 1);
1355
- this.logger.log(`call login method, loginRedirectUrl: ${this.router.url || '/'}`);
1352
+ login(targetUrl) {
1353
+ const returnUrl = targetUrl || this.router.url || '/';
1354
+ this.cookiesService.setCookie('loginRedirectUrl', returnUrl, 1);
1355
+ this.logger.log(`call login method, loginRedirectUrl: ${returnUrl}`);
1356
1356
  // electron
1357
1357
  if (typeof (process) !== 'undefined' &&
1358
1358
  typeof (process?.version) !== 'undefined' &&
@@ -1390,7 +1390,7 @@ class AuthenticationService {
1390
1390
  }
1391
1391
  get isAuthenticated$() {
1392
1392
  return this.oidc.isAuthenticated$.pipe(map((isAuthenticated) => {
1393
- this.logger.warn(`oidc isAuthenticated$ check, response: ${JSON.stringify(isAuthenticated)}; looking for isAuthenticated of ${this.currentProvider?.configId} configId`);
1393
+ this.logger.log(`oidc isAuthenticated$ check, response: ${JSON.stringify(isAuthenticated)}; looking for isAuthenticated of ${this.currentProvider?.configId} configId`);
1394
1394
  return isAuthenticated.allConfigsAuthenticated.find(o => o.configId === this.currentProvider?.configId)?.isAuthenticated || false;
1395
1395
  }));
1396
1396
  }
@@ -2350,7 +2350,7 @@ const oauthGuard = (route, state) => {
2350
2350
  const authService = inject(AuthenticationService);
2351
2351
  return authService.isAuthenticated$.pipe(take(1), map((isAuthenticated) => {
2352
2352
  if (!isAuthenticated) {
2353
- authService.login();
2353
+ authService.login(state.url);
2354
2354
  return false;
2355
2355
  }
2356
2356
  return true;