@dontdrinkandroot/ngx-extensions 0.3.1 → 0.3.2

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.
Files changed (30) hide show
  1. package/esm2020/src/cookie/cookie.service.mjs +3 -3
  2. package/esm2020/src/ddr-extensions.module.mjs +11 -11
  3. package/esm2020/src/http/redirect-to-login-interceptor.service.mjs +3 -3
  4. package/esm2020/src/http/with-credentials-interceptor.service.mjs +3 -3
  5. package/esm2020/src/image/lazy-image.directive.mjs +3 -3
  6. package/esm2020/src/jwt/jwt-interceptor.service.mjs +3 -3
  7. package/esm2020/src/jwt/jwt-refresh-token-interceptor.service.mjs +3 -3
  8. package/esm2020/src/jwt/jwt.service.mjs +9 -7
  9. package/esm2020/src/logger/console-logger.service.mjs +14 -14
  10. package/esm2020/src/logger/logger.service.mjs +2 -2
  11. package/esm2020/src/oauth/oauth2-access-token-interceptor.service.mjs +3 -3
  12. package/esm2020/src/oauth/oauth2-refresh-token-interceptor.service.mjs +3 -3
  13. package/esm2020/src/oauth/oauth2.module.mjs +4 -4
  14. package/esm2020/src/oauth/oauth2.service.mjs +16 -10
  15. package/esm2020/src/oauth/redirect-to-oauth2-login-interceptor.service.mjs +3 -3
  16. package/esm2020/src/scroll/bottom-hit.directive.mjs +3 -3
  17. package/esm2020/src/scroll/scroll.service.mjs +3 -3
  18. package/esm2020/src/storage/local-storage.service.mjs +7 -7
  19. package/esm2020/src/visibility/visibility.service.mjs +4 -4
  20. package/fesm2015/dontdrinkandroot-ngx-extensions.mjs +85 -79
  21. package/fesm2015/dontdrinkandroot-ngx-extensions.mjs.map +1 -1
  22. package/fesm2020/dontdrinkandroot-ngx-extensions.mjs +85 -79
  23. package/fesm2020/dontdrinkandroot-ngx-extensions.mjs.map +1 -1
  24. package/package.json +1 -1
  25. package/src/jwt/jwt.service.d.ts +3 -1
  26. package/src/logger/console-logger.service.d.ts +8 -8
  27. package/src/logger/logger.service.d.ts +5 -5
  28. package/src/oauth/oauth2.service.d.ts +3 -1
  29. package/src/storage/local-storage.service.d.ts +4 -4
  30. package/src/visibility/visibility.service.d.ts +1 -1
@@ -171,15 +171,15 @@ class LazyImageDirective {
171
171
  return window.getComputedStyle(element).display === 'none';
172
172
  }
173
173
  }
174
- LazyImageDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: LazyImageDirective, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
175
- LazyImageDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.3", type: LazyImageDirective, selector: "[ddrLazyImage]", inputs: { src: ["ddrLazyImage", "src"], objectFit: "objectFit", offset: "offset" }, host: { listeners: { "window:resize": "windowResized($event)", "window:scroll": "windowScroll($event)" }, properties: { "src": "this.hostSrc", "style.width.px": "this.hostStyleWidthPx", "style.height.px": "this.hostStyleHeightPx", "style.object-fit": "this.hostStyleObjectFit" } }, usesOnChanges: true, ngImport: i0 });
174
+ LazyImageDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: LazyImageDirective, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
175
+ LazyImageDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.4", type: LazyImageDirective, selector: "[ddrLazyImage]", inputs: { src: ["ddrLazyImage", "src"], objectFit: "objectFit", offset: "offset" }, host: { listeners: { "window:resize": "windowResized($event)", "window:scroll": "windowScroll($event)" }, properties: { "src": "this.hostSrc", "style.width.px": "this.hostStyleWidthPx", "style.height.px": "this.hostStyleHeightPx", "style.object-fit": "this.hostStyleObjectFit" } }, usesOnChanges: true, ngImport: i0 });
176
176
  __decorate([
177
177
  Debounce()
178
178
  ], LazyImageDirective.prototype, "windowResized", null);
179
179
  __decorate([
180
180
  Limit()
181
181
  ], LazyImageDirective.prototype, "windowScroll", null);
182
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: LazyImageDirective, decorators: [{
182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: LazyImageDirective, decorators: [{
183
183
  type: Directive,
184
184
  args: [{ selector: '[ddrLazyImage]' }]
185
185
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { src: [{
@@ -240,15 +240,15 @@ class BottomHitDirective {
240
240
  }
241
241
  }
242
242
  }
243
- BottomHitDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: BottomHitDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
244
- BottomHitDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.3", type: BottomHitDirective, selector: "[ddrBottomHit]", outputs: { onWindowBottomHit: "onWindowBottomHit", onElementBottomHit: "onElementBottomHit" }, host: { listeners: { "scroll": "scrolled($event)", "window:scroll": "windowScrolled($event)" } }, ngImport: i0 });
243
+ BottomHitDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: BottomHitDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
244
+ BottomHitDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.4", type: BottomHitDirective, selector: "[ddrBottomHit]", outputs: { onWindowBottomHit: "onWindowBottomHit", onElementBottomHit: "onElementBottomHit" }, host: { listeners: { "scroll": "scrolled($event)", "window:scroll": "windowScrolled($event)" } }, ngImport: i0 });
245
245
  __decorate([
246
246
  Limit()
247
247
  ], BottomHitDirective.prototype, "scrolled", null);
248
248
  __decorate([
249
249
  Limit()
250
250
  ], BottomHitDirective.prototype, "windowScrolled", null);
251
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: BottomHitDirective, decorators: [{
251
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: BottomHitDirective, decorators: [{
252
252
  type: Directive,
253
253
  args: [{
254
254
  selector: '[ddrBottomHit]'
@@ -265,7 +265,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
265
265
  args: ['window:scroll', ['$event']]
266
266
  }] } });
267
267
 
268
- class LoggerService {
268
+ class Logger {
269
269
  constructor() {
270
270
  this.debugEnabled = false;
271
271
  this.infoEnabled = true;
@@ -274,43 +274,43 @@ class LoggerService {
274
274
  }
275
275
  }
276
276
 
277
- class ConsoleLoggerService extends LoggerService {
277
+ class ConsoleLogger extends Logger {
278
278
  /**
279
279
  * @override
280
280
  */
281
- debug(message, ...optionalParams) {
281
+ debug(...data) {
282
282
  if (this.debugEnabled) {
283
- console.debug(message, optionalParams);
283
+ console.debug(...data);
284
284
  }
285
285
  }
286
286
  /**
287
287
  * @override
288
288
  */
289
- info(message, ...optionalParams) {
289
+ info(...data) {
290
290
  if (this.infoEnabled) {
291
- console.info(message, optionalParams);
291
+ console.info(...data);
292
292
  }
293
293
  }
294
294
  /**
295
295
  * @override
296
296
  */
297
- warn(message, ...optionalParams) {
297
+ warn(...data) {
298
298
  if (this.warnEnabled) {
299
- console.warn(message, optionalParams);
299
+ console.warn(...data);
300
300
  }
301
301
  }
302
302
  /**
303
303
  * @override
304
304
  */
305
- error(message, ...optionalParams) {
305
+ error(...data) {
306
306
  if (this.errorEnabled) {
307
- console.error(message, optionalParams);
307
+ console.error(...data);
308
308
  }
309
309
  }
310
310
  }
311
- ConsoleLoggerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ConsoleLoggerService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
312
- ConsoleLoggerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ConsoleLoggerService });
313
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ConsoleLoggerService, decorators: [{
311
+ ConsoleLogger.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: ConsoleLogger, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
312
+ ConsoleLogger.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: ConsoleLogger });
313
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: ConsoleLogger, decorators: [{
314
314
  type: Injectable
315
315
  }] });
316
316
 
@@ -358,31 +358,31 @@ class LocalStorageService extends StorageService {
358
358
  return this.storagePrefix + '.' + key;
359
359
  }
360
360
  }
361
- LocalStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: LocalStorageService, deps: [{ token: DDR_STORAGE_PREFIX }, { token: LoggerService }], target: i0.ɵɵFactoryTarget.Injectable });
362
- LocalStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: LocalStorageService });
363
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: LocalStorageService, decorators: [{
361
+ LocalStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: LocalStorageService, deps: [{ token: DDR_STORAGE_PREFIX }, { token: Logger }], target: i0.ɵɵFactoryTarget.Injectable });
362
+ LocalStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: LocalStorageService });
363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: LocalStorageService, decorators: [{
364
364
  type: Injectable
365
365
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
366
366
  type: Inject,
367
367
  args: [DDR_STORAGE_PREFIX]
368
- }] }, { type: LoggerService }]; } });
368
+ }] }, { type: Logger }]; } });
369
369
 
370
370
  const DDR_JWT_REFRESH_TOKEN_URL = new InjectionToken('DDR_JWT_REFRESH_TOKEN_URL');
371
371
  const DDR_LOGIN_PATH = new InjectionToken('DDR_LOGIN_PATH');
372
372
  class DdrExtensionsModule {
373
373
  }
374
- DdrExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: DdrExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
375
- DdrExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: DdrExtensionsModule, declarations: [LazyImageDirective,
374
+ DdrExtensionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: DdrExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
375
+ DdrExtensionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.4", ngImport: i0, type: DdrExtensionsModule, declarations: [LazyImageDirective,
376
376
  BottomHitDirective], exports: [LazyImageDirective,
377
377
  BottomHitDirective] });
378
- DdrExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: DdrExtensionsModule, providers: [
378
+ DdrExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: DdrExtensionsModule, providers: [
379
379
  {
380
380
  provide: DDR_LOGIN_PATH,
381
381
  useValue: '/login'
382
382
  },
383
383
  {
384
- provide: LoggerService,
385
- useClass: ConsoleLoggerService
384
+ provide: Logger,
385
+ useClass: ConsoleLogger
386
386
  },
387
387
  {
388
388
  provide: DDR_STORAGE_PREFIX,
@@ -393,7 +393,7 @@ DdrExtensionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
393
393
  useClass: LocalStorageService
394
394
  },
395
395
  ] });
396
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: DdrExtensionsModule, decorators: [{
396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: DdrExtensionsModule, decorators: [{
397
397
  type: NgModule,
398
398
  args: [{
399
399
  declarations: [
@@ -407,8 +407,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
407
407
  useValue: '/login'
408
408
  },
409
409
  {
410
- provide: LoggerService,
411
- useClass: ConsoleLoggerService
410
+ provide: Logger,
411
+ useClass: ConsoleLogger
412
412
  },
413
413
  {
414
414
  provide: DDR_STORAGE_PREFIX,
@@ -544,9 +544,9 @@ class CookieService {
544
544
  return new RegExp('(?:^' + escapedName + '|;\\s*' + escapedName + ')=(.*?)(?:;|$)', 'g');
545
545
  }
546
546
  }
547
- CookieService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: CookieService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
548
- CookieService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: CookieService, providedIn: 'root' });
549
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: CookieService, decorators: [{
547
+ CookieService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: CookieService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
548
+ CookieService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: CookieService, providedIn: 'root' });
549
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: CookieService, decorators: [{
550
550
  type: Injectable,
551
551
  args: [{
552
552
  providedIn: 'root'
@@ -624,9 +624,9 @@ class ScrollService {
624
624
  }
625
625
  }
626
626
  }
627
- ScrollService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ScrollService, deps: [{ token: i1.Router }, { token: i2.ViewportScroller }], target: i0.ɵɵFactoryTarget.Injectable });
628
- ScrollService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ScrollService, providedIn: 'root' });
629
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ScrollService, decorators: [{
627
+ ScrollService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: ScrollService, deps: [{ token: i1.Router }, { token: i2.ViewportScroller }], target: i0.ɵɵFactoryTarget.Injectable });
628
+ ScrollService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: ScrollService, providedIn: 'root' });
629
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: ScrollService, decorators: [{
630
630
  type: Injectable,
631
631
  args: [{
632
632
  providedIn: 'root'
@@ -641,9 +641,9 @@ class VisibilityService {
641
641
  return this.visibility$;
642
642
  }
643
643
  }
644
- VisibilityService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: VisibilityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
645
- VisibilityService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: VisibilityService, providedIn: 'root' });
646
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: VisibilityService, decorators: [{
644
+ VisibilityService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: VisibilityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
645
+ VisibilityService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: VisibilityService, providedIn: 'root' });
646
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: VisibilityService, decorators: [{
647
647
  type: Injectable,
648
648
  args: [{ providedIn: 'root' }]
649
649
  }], ctorParameters: function () { return []; } });
@@ -659,9 +659,9 @@ class WithCredentialsInterceptor {
659
659
  return next.handle(cloned);
660
660
  }
661
661
  }
662
- WithCredentialsInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: WithCredentialsInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
663
- WithCredentialsInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: WithCredentialsInterceptor });
664
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: WithCredentialsInterceptor, decorators: [{
662
+ WithCredentialsInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: WithCredentialsInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
663
+ WithCredentialsInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: WithCredentialsInterceptor });
664
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: WithCredentialsInterceptor, decorators: [{
665
665
  type: Injectable
666
666
  }] });
667
667
 
@@ -710,9 +710,9 @@ class RedirectToLoginInterceptor {
710
710
  }));
711
711
  }
712
712
  }
713
- RedirectToLoginInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: RedirectToLoginInterceptor, deps: [{ token: i1.Router }, { token: DDR_LOGIN_PATH }], target: i0.ɵɵFactoryTarget.Injectable });
714
- RedirectToLoginInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: RedirectToLoginInterceptor });
715
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: RedirectToLoginInterceptor, decorators: [{
713
+ RedirectToLoginInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: RedirectToLoginInterceptor, deps: [{ token: i1.Router }, { token: DDR_LOGIN_PATH }], target: i0.ɵɵFactoryTarget.Injectable });
714
+ RedirectToLoginInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: RedirectToLoginInterceptor });
715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: RedirectToLoginInterceptor, decorators: [{
716
716
  type: Injectable
717
717
  }], ctorParameters: function () { return [{ type: i1.Router }, { type: undefined, decorators: [{
718
718
  type: Inject,
@@ -738,9 +738,10 @@ OAuth2Error.CODE_NOT_FOUND = 'code_not_found';
738
738
  OAuth2Error.ACCESS_DENIED = 'access_denied';
739
739
 
740
740
  class OAuth2Service {
741
- constructor(route, httpClient, config) {
741
+ constructor(route, httpClient, loggerService, config) {
742
742
  this.route = route;
743
743
  this.httpClient = httpClient;
744
+ this.loggerService = loggerService;
744
745
  this.config = config;
745
746
  this.accessTokenString = null;
746
747
  this.accessToken = null;
@@ -796,12 +797,16 @@ class OAuth2Service {
796
797
  }
797
798
  performRefresh() {
798
799
  if (null == this.refreshTokenRequest$) {
799
- console.log('Performing token refesh');
800
+ this.loggerService.info('Performing token refesh');
800
801
  const params = new HttpParams()
801
802
  .set('grant_type', 'refresh_token')
802
803
  .set('refresh_token', TypeUtils.notNull(this.getRefreshToken()))
803
804
  .set('client_id', this.config.clientId);
804
- this.refreshTokenRequest$ = this.httpClient.post(this.config.tokenUri, params).pipe(map(tokenResponse => this.processTokenResponse(tokenResponse)), catchError(error => {
805
+ this.refreshTokenRequest$ = this.httpClient.post(this.config.tokenUri, params).pipe(map(tokenResponse => {
806
+ const token = this.processTokenResponse(tokenResponse);
807
+ this.refreshTokenRequest$ = null;
808
+ return token;
809
+ }), catchError(error => {
805
810
  this.accessTokenString = null;
806
811
  this.accessToken = null;
807
812
  localStorage.removeItem(OAuth2Service.STORAGE_KEY_REFRESH_TOKEN);
@@ -815,7 +820,7 @@ class OAuth2Service {
815
820
  localStorage.removeItem(OAuth2Service.STORAGE_KEY_CHALLENGE);
816
821
  this.accessTokenString = tokenResponse.access_token;
817
822
  this.accessToken = JSON.parse(atob(tokenResponse.access_token.split('.')[1]));
818
- console.log('Access Token Expiry', new Date(this.accessToken.exp * 1000));
823
+ this.loggerService.info('Access Token Expiry', new Date(this.accessToken.exp * 1000));
819
824
  localStorage.setItem(OAuth2Service.STORAGE_KEY_REFRESH_TOKEN, tokenResponse.refresh_token);
820
825
  return this.accessToken;
821
826
  }
@@ -835,11 +840,11 @@ class OAuth2Service {
835
840
  OAuth2Service.STORAGE_KEY_CHALLENGE = 'ddr_oauth2_challenge';
836
841
  OAuth2Service.STORAGE_KEY_REFRESH_TOKEN = 'ddr_oauth2_refresh_token';
837
842
  OAuth2Service.STORAGE_KEY_RETURN_URL = 'ddr_oauth2_return_url';
838
- OAuth2Service.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: OAuth2Service, deps: [{ token: i1.ActivatedRoute }, { token: i2$1.HttpClient }, { token: DDR_OAUTH2_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
839
- OAuth2Service.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: OAuth2Service });
840
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: OAuth2Service, decorators: [{
843
+ OAuth2Service.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: OAuth2Service, deps: [{ token: i1.ActivatedRoute }, { token: i2$1.HttpClient }, { token: Logger }, { token: DDR_OAUTH2_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
844
+ OAuth2Service.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: OAuth2Service });
845
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: OAuth2Service, decorators: [{
841
846
  type: Injectable
842
- }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2$1.HttpClient }, { type: OAuth2Config, decorators: [{
847
+ }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2$1.HttpClient }, { type: Logger }, { type: OAuth2Config, decorators: [{
843
848
  type: Inject,
844
849
  args: [DDR_OAUTH2_CONFIG]
845
850
  }] }]; } });
@@ -858,9 +863,9 @@ class OAuth2RefreshTokenInterceptor {
858
863
  return next.handle(req);
859
864
  }
860
865
  }
861
- OAuth2RefreshTokenInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: OAuth2RefreshTokenInterceptor, deps: [{ token: OAuth2Service }], target: i0.ɵɵFactoryTarget.Injectable });
862
- OAuth2RefreshTokenInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: OAuth2RefreshTokenInterceptor });
863
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: OAuth2RefreshTokenInterceptor, decorators: [{
866
+ OAuth2RefreshTokenInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: OAuth2RefreshTokenInterceptor, deps: [{ token: OAuth2Service }], target: i0.ɵɵFactoryTarget.Injectable });
867
+ OAuth2RefreshTokenInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: OAuth2RefreshTokenInterceptor });
868
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: OAuth2RefreshTokenInterceptor, decorators: [{
864
869
  type: Injectable
865
870
  }], ctorParameters: function () { return [{ type: OAuth2Service }]; } });
866
871
 
@@ -887,9 +892,9 @@ class RedirectToOAuth2LoginInterceptor {
887
892
  }));
888
893
  }
889
894
  }
890
- RedirectToOAuth2LoginInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: RedirectToOAuth2LoginInterceptor, deps: [{ token: OAuth2Service }, { token: i1.Router }, { token: DDR_OAUTH2_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
891
- RedirectToOAuth2LoginInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: RedirectToOAuth2LoginInterceptor });
892
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: RedirectToOAuth2LoginInterceptor, decorators: [{
895
+ RedirectToOAuth2LoginInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: RedirectToOAuth2LoginInterceptor, deps: [{ token: OAuth2Service }, { token: i1.Router }, { token: DDR_OAUTH2_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
896
+ RedirectToOAuth2LoginInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: RedirectToOAuth2LoginInterceptor });
897
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: RedirectToOAuth2LoginInterceptor, decorators: [{
893
898
  type: Injectable
894
899
  }], ctorParameters: function () { return [{ type: OAuth2Service }, { type: i1.Router }, { type: OAuth2Config, decorators: [{
895
900
  type: Inject,
@@ -913,9 +918,9 @@ class OAuth2AccessTokenInterceptor {
913
918
  return next.handle(req);
914
919
  }
915
920
  }
916
- OAuth2AccessTokenInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: OAuth2AccessTokenInterceptor, deps: [{ token: OAuth2Service }], target: i0.ɵɵFactoryTarget.Injectable });
917
- OAuth2AccessTokenInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: OAuth2AccessTokenInterceptor });
918
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: OAuth2AccessTokenInterceptor, decorators: [{
921
+ OAuth2AccessTokenInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: OAuth2AccessTokenInterceptor, deps: [{ token: OAuth2Service }], target: i0.ɵɵFactoryTarget.Injectable });
922
+ OAuth2AccessTokenInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: OAuth2AccessTokenInterceptor });
923
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: OAuth2AccessTokenInterceptor, decorators: [{
919
924
  type: Injectable
920
925
  }], ctorParameters: function () { return [{ type: OAuth2Service }]; } });
921
926
 
@@ -948,10 +953,10 @@ class OAuth2Module {
948
953
  };
949
954
  }
950
955
  }
951
- OAuth2Module.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: OAuth2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
952
- OAuth2Module.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: OAuth2Module });
953
- OAuth2Module.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: OAuth2Module });
954
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: OAuth2Module, decorators: [{
956
+ OAuth2Module.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: OAuth2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
957
+ OAuth2Module.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.4", ngImport: i0, type: OAuth2Module });
958
+ OAuth2Module.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: OAuth2Module });
959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: OAuth2Module, decorators: [{
955
960
  type: NgModule
956
961
  }] });
957
962
 
@@ -960,8 +965,9 @@ function isNonNull(value) {
960
965
  }
961
966
 
962
967
  class JwtService {
963
- constructor(storageService) {
968
+ constructor(storageService, loggerService) {
964
969
  this.storageService = storageService;
970
+ this.loggerService = loggerService;
965
971
  /**
966
972
  * The current token.
967
973
  */
@@ -985,7 +991,7 @@ class JwtService {
985
991
  this.token = token;
986
992
  const decodedToken = JSON.parse(atob(token.split('.')[1]));
987
993
  this.tokenExpiry = decodedToken.exp * 1000;
988
- console.log('New refresh token, expiry', new Date(this.tokenExpiry));
994
+ this.loggerService.info('New refresh token, expiry', new Date(this.tokenExpiry));
989
995
  }
990
996
  /**
991
997
  * Gets the current token.
@@ -1026,14 +1032,14 @@ class JwtService {
1026
1032
  return 'jwt.refresh_token';
1027
1033
  }
1028
1034
  }
1029
- JwtService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: JwtService, deps: [{ token: StorageService }], target: i0.ɵɵFactoryTarget.Injectable });
1030
- JwtService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: JwtService, providedIn: 'root' });
1031
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: JwtService, decorators: [{
1035
+ JwtService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: JwtService, deps: [{ token: StorageService }, { token: Logger }], target: i0.ɵɵFactoryTarget.Injectable });
1036
+ JwtService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: JwtService, providedIn: 'root' });
1037
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: JwtService, decorators: [{
1032
1038
  type: Injectable,
1033
1039
  args: [{
1034
1040
  providedIn: 'root'
1035
1041
  }]
1036
- }], ctorParameters: function () { return [{ type: StorageService }]; } });
1042
+ }], ctorParameters: function () { return [{ type: StorageService }, { type: Logger }]; } });
1037
1043
 
1038
1044
  class JwtInterceptor {
1039
1045
  constructor(jwtService) {
@@ -1052,9 +1058,9 @@ class JwtInterceptor {
1052
1058
  return next.handle(req);
1053
1059
  }
1054
1060
  }
1055
- JwtInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: JwtInterceptor, deps: [{ token: JwtService }], target: i0.ɵɵFactoryTarget.Injectable });
1056
- JwtInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: JwtInterceptor });
1057
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: JwtInterceptor, decorators: [{
1061
+ JwtInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: JwtInterceptor, deps: [{ token: JwtService }], target: i0.ɵɵFactoryTarget.Injectable });
1062
+ JwtInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: JwtInterceptor });
1063
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: JwtInterceptor, decorators: [{
1058
1064
  type: Injectable
1059
1065
  }], ctorParameters: function () { return [{ type: JwtService }]; } });
1060
1066
 
@@ -1092,9 +1098,9 @@ class JwtRefreshTokenInterceptor {
1092
1098
  return this.refreshTokenRequest$;
1093
1099
  }
1094
1100
  }
1095
- JwtRefreshTokenInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: JwtRefreshTokenInterceptor, deps: [{ token: JwtService }, { token: i2$1.HttpClient }, { token: DDR_JWT_REFRESH_TOKEN_URL }], target: i0.ɵɵFactoryTarget.Injectable });
1096
- JwtRefreshTokenInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: JwtRefreshTokenInterceptor });
1097
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: JwtRefreshTokenInterceptor, decorators: [{
1101
+ JwtRefreshTokenInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: JwtRefreshTokenInterceptor, deps: [{ token: JwtService }, { token: i2$1.HttpClient }, { token: DDR_JWT_REFRESH_TOKEN_URL }], target: i0.ɵɵFactoryTarget.Injectable });
1102
+ JwtRefreshTokenInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: JwtRefreshTokenInterceptor });
1103
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: JwtRefreshTokenInterceptor, decorators: [{
1098
1104
  type: Injectable
1099
1105
  }], ctorParameters: function () { return [{ type: JwtService }, { type: i2$1.HttpClient }, { type: undefined, decorators: [{
1100
1106
  type: Inject,