@huntsman-cancer-institute/authentication 15.0.2 → 16.0.0

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.
@@ -0,0 +1,148 @@
1
+ /*
2
+ * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
3
+ */
4
+ import { Component } from "@angular/core";
5
+ import { animate, state, style, transition, trigger } from "@angular/animations";
6
+ import { timer } from "rxjs";
7
+ import { map, takeWhile } from "rxjs/operators";
8
+ import { AuthenticationService } from "./authentication.service";
9
+ import * as i0 from "@angular/core";
10
+ import * as i1 from "./authentication.service";
11
+ import * as i2 from "@angular/common";
12
+ export class TimeoutNotificationComponent {
13
+ constructor(authenticationService) {
14
+ this.authenticationService = authenticationService;
15
+ this.openState = "hidden";
16
+ authenticationService.isAboutToTimeOut().subscribe((isAboutToTimeOut) => {
17
+ if (isAboutToTimeOut) {
18
+ this.openState = "opened";
19
+ this.startCountdown();
20
+ }
21
+ else {
22
+ this.openState = "hidden";
23
+ //If something changed mid-timeout, cancel the timeout/logout.
24
+ if (this.subscription != null && !this.subscription.closed) {
25
+ this.subscription.unsubscribe();
26
+ }
27
+ }
28
+ });
29
+ }
30
+ startCountdown() {
31
+ this.seconds = timer(0, 1000)
32
+ .pipe(map(() => {
33
+ const elapsed = Math.round((Date.now() - this.authenticationService.getTimeoutStart()) / 1000);
34
+ return this.authenticationService.userCountdownSeconds - elapsed;
35
+ }),
36
+ // The true argument emits the final value that completed the observable
37
+ takeWhile((value) => value > 0, true));
38
+ this.subscription = this.seconds.subscribe((value) => {
39
+ if (value < 1) {
40
+ this.subscription.unsubscribe();
41
+ this.authenticationService.logout(true);
42
+ }
43
+ });
44
+ }
45
+ click() {
46
+ this.subscription.unsubscribe();
47
+ this.authenticationService.updateUserActivity();
48
+ }
49
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TimeoutNotificationComponent, deps: [{ token: i1.AuthenticationService }], target: i0.ɵɵFactoryTarget.Component }); }
50
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TimeoutNotificationComponent, selector: "timeout-notification", ngImport: i0, template: `
51
+ <div class="flyout-max" [@openBacksplash]="openState">
52
+ <div class="modal-dialog" [@openModal]="openState" role="document">
53
+ <div class="modal-header">
54
+ <h4 class="modal-title">Your Session Is About To Expire</h4>
55
+ </div>
56
+ <div class="modal-body">
57
+ <p>For your security, your session is about to automatically time out in the next <b>{{seconds | async}}</b> seconds. Would you like to stay signed in?</p>
58
+ </div>
59
+ <div class="modal-footer">
60
+ <ng-container>
61
+ <button id="updateBtn" type="button" class="btn btn-secondary" (click)="click()">Yes, Keep me signed in</button>
62
+ </ng-container>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ `, isInline: true, styles: [".flyout-max{position:fixed;z-index:9999;top:0;bottom:0;background-color:#0006;width:100vw}.modal-dialog{position:fixed;max-width:50vw;min-width:50vw;left:-50vw;top:25vw;margin:0;background-color:#fff;border:black 1px solid;border-left:none;border-radius:20px;pointer-events:all}.modal-body{width:100%;display:inline-block}.modal-body-left{display:inline-block;overflow-y:auto;overflow-x:hidden;min-height:300px;max-height:300px}.modal-body-right{width:70%;vertical-align:top;padding-left:15px;border-left:black 1px solid;margin-left:15px;display:inline-block;overflow-y:auto;min-height:300px;max-height:300px}\n"], dependencies: [{ kind: "pipe", type: i2.AsyncPipe, name: "async" }], animations: [
67
+ trigger("openBacksplash", [
68
+ state("in", style({
69
+ "display": "none"
70
+ })),
71
+ state("hidden", style({
72
+ "display": "none"
73
+ })),
74
+ state("opened", style({
75
+ "display": "inherit"
76
+ })),
77
+ transition("hidden => opened", animate(100)),
78
+ transition("opened => hidden", animate(200))
79
+ ]),
80
+ trigger("openModal", [
81
+ state("in", style({
82
+ "opacity": "0",
83
+ "left": "-50vw"
84
+ })),
85
+ state("hidden", style({
86
+ "opacity": "0",
87
+ "left": "-50vw"
88
+ })),
89
+ state("opened", style({
90
+ "opacity": "1",
91
+ "left": "25vw"
92
+ })),
93
+ transition("hidden => opened", animate(500)),
94
+ transition("opened => hidden", animate(300))
95
+ ])
96
+ ] }); }
97
+ }
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TimeoutNotificationComponent, decorators: [{
99
+ type: Component,
100
+ args: [{ selector: "timeout-notification", template: `
101
+ <div class="flyout-max" [@openBacksplash]="openState">
102
+ <div class="modal-dialog" [@openModal]="openState" role="document">
103
+ <div class="modal-header">
104
+ <h4 class="modal-title">Your Session Is About To Expire</h4>
105
+ </div>
106
+ <div class="modal-body">
107
+ <p>For your security, your session is about to automatically time out in the next <b>{{seconds | async}}</b> seconds. Would you like to stay signed in?</p>
108
+ </div>
109
+ <div class="modal-footer">
110
+ <ng-container>
111
+ <button id="updateBtn" type="button" class="btn btn-secondary" (click)="click()">Yes, Keep me signed in</button>
112
+ </ng-container>
113
+ </div>
114
+ </div>
115
+ </div>
116
+ `, animations: [
117
+ trigger("openBacksplash", [
118
+ state("in", style({
119
+ "display": "none"
120
+ })),
121
+ state("hidden", style({
122
+ "display": "none"
123
+ })),
124
+ state("opened", style({
125
+ "display": "inherit"
126
+ })),
127
+ transition("hidden => opened", animate(100)),
128
+ transition("opened => hidden", animate(200))
129
+ ]),
130
+ trigger("openModal", [
131
+ state("in", style({
132
+ "opacity": "0",
133
+ "left": "-50vw"
134
+ })),
135
+ state("hidden", style({
136
+ "opacity": "0",
137
+ "left": "-50vw"
138
+ })),
139
+ state("opened", style({
140
+ "opacity": "1",
141
+ "left": "25vw"
142
+ })),
143
+ transition("hidden => opened", animate(500)),
144
+ transition("opened => hidden", animate(300))
145
+ ])
146
+ ], styles: [".flyout-max{position:fixed;z-index:9999;top:0;bottom:0;background-color:#0006;width:100vw}.modal-dialog{position:fixed;max-width:50vw;min-width:50vw;left:-50vw;top:25vw;margin:0;background-color:#fff;border:black 1px solid;border-left:none;border-radius:20px;pointer-events:all}.modal-body{width:100%;display:inline-block}.modal-body-left{display:inline-block;overflow-y:auto;overflow-x:hidden;min-height:300px;max-height:300px}.modal-body-right{width:70%;vertical-align:top;padding-left:15px;border-left:black 1px solid;margin-left:15px;display:inline-block;overflow-y:auto;min-height:300px;max-height:300px}\n"] }]
147
+ }], ctorParameters: function () { return [{ type: i1.AuthenticationService }]; } });
148
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZW91dC1ub3RpZmljYXRpb24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvYXV0aGVudGljYXRpb24vc3JjL3RpbWVvdXQtbm90aWZpY2F0aW9uLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILE9BQU8sRUFBQyxTQUFTLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDeEMsT0FBTyxFQUFDLE9BQU8sRUFBRSxLQUFLLEVBQUUsS0FBSyxFQUFFLFVBQVUsRUFBRSxPQUFPLEVBQUMsTUFBTSxxQkFBcUIsQ0FBQztBQUUvRSxPQUFPLEVBQTJCLEtBQUssRUFBQyxNQUFNLE1BQU0sQ0FBQztBQUNyRCxPQUFPLEVBQUMsR0FBRyxFQUFFLFNBQVMsRUFBQyxNQUFNLGdCQUFnQixDQUFDO0FBRTlDLE9BQU8sRUFBQyxxQkFBcUIsRUFBQyxNQUFNLDBCQUEwQixDQUFDOzs7O0FBOEcvRCxNQUFNLE9BQU8sNEJBQTRCO0lBTXZDLFlBQW9CLHFCQUE0QztRQUE1QywwQkFBcUIsR0FBckIscUJBQXFCLENBQXVCO1FBSnpELGNBQVMsR0FBVyxRQUFRLENBQUM7UUFLbEMscUJBQXFCLENBQUMsZ0JBQWdCLEVBQUUsQ0FBQyxTQUFTLENBQUMsQ0FBQyxnQkFBZ0IsRUF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H0pKSxcclxuICAgICAgICBzdGF0ZShcImhpZGRlblwiLCBzdHlsZSh7XHJcbiAgICAgICAgICBcIm9wYWNpdHlcIjogXCIwXCIsXHJcbiAgICAgICAgICBcImxlZnRcIjogXCItNTB2d1wiXHJcbiAgICAgICAgfSkpLFxyXG4gICAgICAgIHN0YXRlKFwib3BlbmVkXCIsIHN0eWxlKHtcclxuICAgICAgICAgIFwib3BhY2l0eVwiOiBcIjFcIixcclxuICAgICAgICAgIFwibGVmdFwiOiBcIjI1dndcIlxyXG4gICAgICAgIH0pKSxcclxuICAgICAgICB0cmFuc2l0aW9uKFwiaGlkZGVuID0+IG9wZW5lZFwiLCBhbmltYXRlKDUwMCkpLFxyXG4gICAgICAgIHRyYW5zaXRpb24oXCJvcGVuZWQgPT4gaGlkZGVuXCIsIGFuaW1hdGUoMzAwKSlcclxuICAgICAgXVxyXG4gICAgKVxyXG4gIF0sXHJcbiAgc3R5bGVzOiBbYFxyXG5cclxuICAgIC5mbHlvdXQtbWF4IHtcclxuICAgICAgcG9zaXRpb246IGZpeGVkO1xyXG4gICAgICB6LWluZGV4OiA5OTk5O1xyXG4gICAgICB0b3A6IDA7XHJcbiAgICAgIGJvdHRvbTogMDtcclxuICAgICAgYmFja2dyb3VuZC1jb2xvcjogcmdiYSgwLCAwLCAwLCAwLjQpO1xyXG4gICAgICB3aWR0aDogMTAwdnc7XHJcbiAgICB9XHJcbiAgICBcclxuICAgIC5tb2RhbC1kaWFsb2cge1xyXG4gICAgICBwb3NpdGlvbjogZml4ZWQ7XHJcbiAgICAgIG1heC13aWR0aDogNTB2dztcclxuICAgICAgbWluLXdpZHRoOiA1MHZ3O1xyXG4gICAgICBsZWZ0OiAtNTB2dztcclxuICAgICAgdG9wOiAyNXZ3O1xyXG4gICAgICBtYXJnaW46IDA7XHJcbiAgICAgIGJhY2tncm91bmQtY29sb3I6IHdoaXRlO1xyXG4gICAgICBib3JkZXI6IGJsYWNrIDFweCBzb2xpZDtcclxuICAgICAgYm9y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xuICAgICAgICAgIGNvbnN0IGVsYXBzZWQ6IG51bWJlciA9IE1hdGgucm91bmQoKERhdGUubm93KCkgLSB0aGlzLmF1dGhlbnRpY2F0aW9uU2VydmljZS5nZXRUaW1lb3V0U3RhcnQoKSkgLyAxMDAwKTtcclxuICAgICAgICAgIHJldHVybiB0aGlzLmF1dGhlbnRpY2F0aW9uU2VydmljZS51c2VyQ291bnRkb3duU2Vjb25kcyAtIGVsYXBzZWQ7XHJcbiAgICAgICAgfSksXHJcbiAgICAgICAgLy8gVGhlIHRydWUgYXJndW1lbnQgZW1pdHMgdGhlIGZpbmFsIHZhbHVlIHRoYXQgY29tcGxldGVkIHRoZSBvYnNlcnZhYmxlXHJcbiAgICAgICAgdGFrZVdoaWxlKCh2YWx1ZSkgPT4gdmFsdWUgPiAwLCB0cnVlKSxcclxuICAgICAgKTtcclxuXHJcbiAgICB0aGlzLnN1YnNjcmlwdGlvbiA9IHRoaXMuc2Vjb25kcy5zdWJzY3JpYmUoKHZhbHVlKSA9PiB7XHJcbiAgICAgICBpZiAodmFsdWUgPCAxKSB7XHJcbiAgICAgICAgIHRoaXMuc3Vic2NyaXB0aW9uLnVuc3Vic2NyaWJlKCk7XHJcbiAgICAgICAgIHRoaXMuYXV0aGVudGljYXRpb25TZXJ2aWNlLmxvZ291dCh0cnVlKTtcclxuICAgICAgIH1cclxuICAgIH0pO1xyXG4gIH1cclxuXHJcbiAgY2xpY2soKTogdm9pZCB7XHJcbiAgICB0aGlzLnN1YnNjcmlwdGlvbi51bnN1YnNjcmliZSgpO1xyXG4gICAgdGhpcy5hdXRoZW50aWNhdGlvblNlcnZpY2UudXBkYXRlVXNlckFjdGl2aXR5KCk7XHJcbiAgfVxyXG59XHJcbiJdfQ==
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, Inject, isDevMode, Optional, Component, ViewChild, NgModule, SkipSelf } from '@angular/core';
2
+ import { InjectionToken, Injectable, Inject, isDevMode, Optional, Component, ViewChild, NgModule, SkipSelf, inject } from '@angular/core';
3
3
  import * as i4$1 from '@angular/common';
4
4
  import { LocationStrategy, CommonModule } from '@angular/common';
5
5
  import * as i2$2 from '@angular/forms';
@@ -7,7 +7,7 @@ import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
7
  import * as i1$1 from '@angular/common/http';
8
8
  import { HttpHeaders, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
9
9
  import * as i2 from '@angular/router';
10
- import { RouterModule } from '@angular/router';
10
+ import { RouterModule, Router, RouterStateSnapshot } from '@angular/router';
11
11
  import * as i1 from '@angular-cool/storage';
12
12
  import { CoolStorageModule } from '@angular-cool/storage';
13
13
  import * as i4 from '@auth0/angular-jwt';
@@ -39,10 +39,10 @@ class AuthenticationProvider {
39
39
  get authToken() {
40
40
  return this._localStorageService.getItem(this._authenticationTokenKey);
41
41
  }
42
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthenticationProvider, deps: [{ token: i1.CoolLocalStorage }, { token: AUTHENTICATION_TOKEN_KEY }], target: i0.ɵɵFactoryTarget.Injectable }); }
43
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthenticationProvider }); }
42
44
  }
43
- AuthenticationProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationProvider, deps: [{ token: i1.CoolLocalStorage }, { token: AUTHENTICATION_TOKEN_KEY }], target: i0.ɵɵFactoryTarget.Injectable });
44
- AuthenticationProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationProvider });
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationProvider, decorators: [{
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthenticationProvider, decorators: [{
46
46
  type: Injectable
47
47
  }], ctorParameters: function () { return [{ type: i1.CoolLocalStorage }, { type: undefined, decorators: [{
48
48
  type: Inject,
@@ -69,6 +69,17 @@ let AUTHENTICATION_IDP_INACTIVITY_MINUTES = new InjectionToken("authentication_i
69
69
  * @since 1.0.0
70
70
  */
71
71
  class AuthenticationService {
72
+ /**
73
+ * The generic error message used when a server error is thrown without a status.
74
+ *
75
+ * @type {string}
76
+ */
77
+ static { this.GENERIC_ERR_MSG = "Server error"; }
78
+ static { this.CONTENT_TYPE = "Content-Type"; }
79
+ static { this.SEC_GOV_CLASS_HEADER = "SecurityGovernorClass"; }
80
+ static { this.SEC_GOV_ID_HEADER = "SecurityGovernorId"; }
81
+ static { this.DEIDENT_HEADER = "DeidentifiedContext"; }
82
+ static { this.LIMITED_HEADER = "LimitedContext"; }
72
83
  constructor(_http, _router, _localStorageService, _jwtHelper, authenticationProvider, _authenticationRoute, _logoutPath, _tokenEndpoint, _serverUrl, _directEndpoint, _maxInactivity, _userCountdownSeconds, _idpInactivityMinutes, locationStrategy) {
73
84
  this._http = _http;
74
85
  this._router = _router;
@@ -369,21 +380,10 @@ class AuthenticationService {
369
380
  let errMsg = (error.message) ? error.message : AuthenticationService.GENERIC_ERR_MSG;
370
381
  return throwError(errMsg);
371
382
  }
383
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthenticationService, deps: [{ token: i1$1.HttpClient }, { token: i2.Router }, { token: i1.CoolLocalStorage }, { token: i4.JwtHelperService }, { token: AuthenticationProvider }, { token: AUTHENTICATION_ROUTE }, { token: AUTHENTICATION_LOGOUT_PATH }, { token: AUTHENTICATION_TOKEN_ENDPOINT }, { token: AUTHENTICATION_SERVER_URL, optional: true }, { token: AUTHENTICATION_DIRECT_ENDPOINT, optional: true }, { token: AUTHENTICATION_MAX_INACTIVITY_MINUTES, optional: true }, { token: AUTHENTICATION_USER_COUNTDOWN_SECONDS, optional: true }, { token: AUTHENTICATION_IDP_INACTIVITY_MINUTES, optional: true }, { token: LocationStrategy, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
384
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthenticationService }); }
372
385
  }
373
- /**
374
- * The generic error message used when a server error is thrown without a status.
375
- *
376
- * @type {string}
377
- */
378
- AuthenticationService.GENERIC_ERR_MSG = "Server error";
379
- AuthenticationService.CONTENT_TYPE = "Content-Type";
380
- AuthenticationService.SEC_GOV_CLASS_HEADER = "SecurityGovernorClass";
381
- AuthenticationService.SEC_GOV_ID_HEADER = "SecurityGovernorId";
382
- AuthenticationService.DEIDENT_HEADER = "DeidentifiedContext";
383
- AuthenticationService.LIMITED_HEADER = "LimitedContext";
384
- AuthenticationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationService, deps: [{ token: i1$1.HttpClient }, { token: i2.Router }, { token: i1.CoolLocalStorage }, { token: i4.JwtHelperService }, { token: AuthenticationProvider }, { token: AUTHENTICATION_ROUTE }, { token: AUTHENTICATION_LOGOUT_PATH }, { token: AUTHENTICATION_TOKEN_ENDPOINT }, { token: AUTHENTICATION_SERVER_URL, optional: true }, { token: AUTHENTICATION_DIRECT_ENDPOINT, optional: true }, { token: AUTHENTICATION_MAX_INACTIVITY_MINUTES, optional: true }, { token: AUTHENTICATION_USER_COUNTDOWN_SECONDS, optional: true }, { token: AUTHENTICATION_IDP_INACTIVITY_MINUTES, optional: true }, { token: LocationStrategy, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
385
- AuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationService });
386
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationService, decorators: [{
386
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthenticationService, decorators: [{
387
387
  type: Injectable
388
388
  }], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: i2.Router }, { type: i1.CoolLocalStorage }, { type: i4.JwtHelperService }, { type: AuthenticationProvider }, { type: undefined, decorators: [{
389
389
  type: Inject,
@@ -426,51 +426,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
426
426
  args: [LocationStrategy]
427
427
  }] }]; } });
428
428
 
429
- /*
430
- * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
431
- */
432
- /**
433
- * A {@code CanActivate} implementation which makes its calculation based on the current authentication state.
434
- *
435
- * @since 1.0.0
436
- */
437
- class RouteGuardService {
438
- constructor(_authenticationService, _router, _authenticationRoute) {
439
- this._authenticationService = _authenticationService;
440
- this._router = _router;
441
- this._authenticationRoute = _authenticationRoute;
442
- }
443
- /**
444
- * Determines whether or not a route can be activated, based on the current authentication state.
445
- *
446
- * @param route for activation to be determined on
447
- * @param state of the router snapshot
448
- * @returns {Observable<boolean>} describing the result of this calculation
449
- */
450
- canActivate(route, state) {
451
- return this._authenticationService.isAuthenticated().pipe(map((authenticated) => {
452
- if (!authenticated) {
453
- // Store the attempted URL for redirecting
454
- this._authenticationService.redirectUrl = state.url;
455
- // Navigate to the login page
456
- this._router.navigate([this._authenticationRoute]);
457
- }
458
- return authenticated;
459
- }, (error) => {
460
- return false;
461
- }));
462
- }
463
- ;
464
- }
465
- RouteGuardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RouteGuardService, deps: [{ token: AuthenticationService }, { token: i2.Router }, { token: AUTHENTICATION_ROUTE }], target: i0.ɵɵFactoryTarget.Injectable });
466
- RouteGuardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RouteGuardService });
467
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RouteGuardService, decorators: [{
468
- type: Injectable
469
- }], ctorParameters: function () { return [{ type: AuthenticationService }, { type: i2.Router }, { type: undefined, decorators: [{
470
- type: Inject,
471
- args: [AUTHENTICATION_ROUTE]
472
- }] }]; } });
473
-
474
429
  /*
475
430
  * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
476
431
  */
@@ -556,9 +511,8 @@ class AuthenticationComponent {
556
511
  this.beginAuthenticationProcess();
557
512
  });
558
513
  }
559
- }
560
- AuthenticationComponentfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationComponent, deps: [{ token: AuthenticationService }, { token: i2$1.DomSanitizer }, { token: i2.Router }, { token: i4$1.Location }, { token: i0.Renderer2 }, { token: AUTHENTICATION_ROUTE }], target: i0.ɵɵFactoryTarget.Component });
561
- AuthenticationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AuthenticationComponent, selector: "authentication-iframe", host: { classAttribute: "outlet-row" }, viewQueries: [{ propertyName: "iframe", first: true, predicate: ["iframe"], descendants: true, static: true }], ngImport: i0, template: `
514
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthenticationComponent, deps: [{ token: AuthenticationService }, { token: i2$1.DomSanitizer }, { token: i2.Router }, { token: i4$1.Location }, { token: i0.Renderer2 }, { token: AUTHENTICATION_ROUTE }], target: i0.ɵɵFactoryTarget.Component }); }
515
+ static { thiscmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AuthenticationComponent, selector: "authentication-iframe", host: { classAttribute: "outlet-row" }, viewQueries: [{ propertyName: "iframe", first: true, predicate: ["iframe"], descendants: true, static: true }], ngImport: i0, template: `
562
516
  <div class="container">
563
517
  <iframe #iframe class="frame" [src]="url" (load)="handleChanges()"></iframe>
564
518
  <div *ngIf="_errorMsg" class="alert-box">
@@ -568,8 +522,9 @@ AuthenticationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0"
568
522
  </div>
569
523
  </div>
570
524
  </div>
571
- `, isInline: true, styles: [":host{background-color:#fff}.container{max-width:100%;margin-top:60px;padding-top:15px}.frame{width:100%;height:100%;border:0px}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
572
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationComponent, decorators: [{
525
+ `, isInline: true, styles: [":host{background-color:#fff}.container{max-width:100%;margin-top:60px;padding-top:15px}.frame{width:100%;height:100%;border:0px}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
526
+ }
527
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthenticationComponent, decorators: [{
573
528
  type: Component,
574
529
  args: [{ selector: "authentication-iframe", template: `
575
530
  <div class="container">
@@ -621,9 +576,8 @@ class DirectLoginComponent {
621
576
  this._errorMsg = "Please check your username and password.";
622
577
  });
623
578
  }
624
- }
625
- DirectLoginComponentfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DirectLoginComponent, deps: [{ token: AuthenticationService }, { token: i2$2.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component });
626
- DirectLoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DirectLoginComponent, selector: "hci-login-form", ngImport: i0, template: `
579
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DirectLoginComponent, deps: [{ token: AuthenticationService }, { token: i2$2.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
580
+ static { thiscmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DirectLoginComponent, selector: "hci-login-form", ngImport: i0, template: `
627
581
  <div class="container">
628
582
  <div class="login-box" id="hci-login-form-box">
629
583
  <div class="login-heading" id="hci-login-form-heading">
@@ -648,8 +602,9 @@ DirectLoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", v
648
602
  </div>
649
603
  </div>
650
604
  </div>
651
- `, isInline: true, styles: [".container{max-width:400px;margin-top:20px;padding-top:15px}.login-box{border-radius:10px;box-shadow:0 0 2px #ccc;padding:15px}.login-box .login-heading h3{line-height:1.5;margin:0 0 10px}.login-box .form-control{padding:10px;border:1px solid #ccc}.login-box input[type=password]{margin-bottom:10px;border-top-left-radius:0;border-top-right-radius:0}.login-box input[type=text]{margin-bottom:-1px;border-bottom-right-radius:0;border-bottom-left-radius:0}.login-box .alert-box{margin:10px 0 -5px}.login-box .alert-text{font-size:small}.login-box .btn-box{margin:10px 0 0}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
652
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DirectLoginComponent, decorators: [{
605
+ `, isInline: true, styles: [".container{max-width:400px;margin-top:20px;padding-top:15px}.login-box{border-radius:10px;box-shadow:0 0 2px #ccc;padding:15px}.login-box .login-heading h3{line-height:1.5;margin:0 0 10px}.login-box .form-control{padding:10px;border:1px solid #ccc}.login-box input[type=password]{margin-bottom:10px;border-top-left-radius:0;border-top-right-radius:0}.login-box input[type=text]{margin-bottom:-1px;border-bottom-right-radius:0;border-bottom-left-radius:0}.login-box .alert-box{margin:10px 0 -5px}.login-box .alert-text{font-size:small}.login-box .btn-box{margin:10px 0 0}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
606
+ }
607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DirectLoginComponent, decorators: [{
653
608
  type: Component,
654
609
  args: [{ selector: "hci-login-form", template: `
655
610
  <div class="container">
@@ -719,9 +674,8 @@ class TimeoutNotificationComponent {
719
674
  this.subscription.unsubscribe();
720
675
  this.authenticationService.updateUserActivity();
721
676
  }
722
- }
723
- TimeoutNotificationComponentfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TimeoutNotificationComponent, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component });
724
- TimeoutNotificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TimeoutNotificationComponent, selector: "timeout-notification", ngImport: i0, template: `
677
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TimeoutNotificationComponent, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component }); }
678
+ static { thiscmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TimeoutNotificationComponent, selector: "timeout-notification", ngImport: i0, template: `
725
679
  <div class="flyout-max" [@openBacksplash]="openState">
726
680
  <div class="modal-dialog" [@openModal]="openState" role="document">
727
681
  <div class="modal-header">
@@ -738,37 +692,38 @@ TimeoutNotificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14
738
692
  </div>
739
693
  </div>
740
694
  `, isInline: true, styles: [".flyout-max{position:fixed;z-index:9999;top:0;bottom:0;background-color:#0006;width:100vw}.modal-dialog{position:fixed;max-width:50vw;min-width:50vw;left:-50vw;top:25vw;margin:0;background-color:#fff;border:black 1px solid;border-left:none;border-radius:20px;pointer-events:all}.modal-body{width:100%;display:inline-block}.modal-body-left{display:inline-block;overflow-y:auto;overflow-x:hidden;min-height:300px;max-height:300px}.modal-body-right{width:70%;vertical-align:top;padding-left:15px;border-left:black 1px solid;margin-left:15px;display:inline-block;overflow-y:auto;min-height:300px;max-height:300px}\n"], dependencies: [{ kind: "pipe", type: i4$1.AsyncPipe, name: "async" }], animations: [
741
- trigger("openBacksplash", [
742
- state("in", style({
743
- "display": "none"
744
- })),
745
- state("hidden", style({
746
- "display": "none"
747
- })),
748
- state("opened", style({
749
- "display": "inherit"
750
- })),
751
- transition("hidden => opened", animate(100)),
752
- transition("opened => hidden", animate(200))
753
- ]),
754
- trigger("openModal", [
755
- state("in", style({
756
- "opacity": "0",
757
- "left": "-50vw"
758
- })),
759
- state("hidden", style({
760
- "opacity": "0",
761
- "left": "-50vw"
762
- })),
763
- state("opened", style({
764
- "opacity": "1",
765
- "left": "25vw"
766
- })),
767
- transition("hidden => opened", animate(500)),
768
- transition("opened => hidden", animate(300))
769
- ])
770
- ] });
771
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TimeoutNotificationComponent, decorators: [{
695
+ trigger("openBacksplash", [
696
+ state("in", style({
697
+ "display": "none"
698
+ })),
699
+ state("hidden", style({
700
+ "display": "none"
701
+ })),
702
+ state("opened", style({
703
+ "display": "inherit"
704
+ })),
705
+ transition("hidden => opened", animate(100)),
706
+ transition("opened => hidden", animate(200))
707
+ ]),
708
+ trigger("openModal", [
709
+ state("in", style({
710
+ "opacity": "0",
711
+ "left": "-50vw"
712
+ })),
713
+ state("hidden", style({
714
+ "opacity": "0",
715
+ "left": "-50vw"
716
+ })),
717
+ state("opened", style({
718
+ "opacity": "1",
719
+ "left": "25vw"
720
+ })),
721
+ transition("hidden => opened", animate(500)),
722
+ transition("opened => hidden", animate(300))
723
+ ])
724
+ ] }); }
725
+ }
726
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TimeoutNotificationComponent, decorators: [{
772
727
  type: Component,
773
728
  args: [{ selector: "timeout-notification", template: `
774
729
  <div class="flyout-max" [@openBacksplash]="openState">
@@ -886,10 +841,10 @@ class AuthorizationInterceptor {
886
841
  return throwError(error);
887
842
  }));
888
843
  }
844
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
845
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthorizationInterceptor }); }
889
846
  }
890
- AuthorizationInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
891
- AuthorizationInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizationInterceptor });
892
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthorizationInterceptor, decorators: [{
847
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthorizationInterceptor, decorators: [{
893
848
  type: Injectable
894
849
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
895
850
 
@@ -914,7 +869,6 @@ class AuthenticationModule {
914
869
  AuthenticationProvider,
915
870
  JwtHelperService,
916
871
  AuthenticationService,
917
- RouteGuardService,
918
872
  {
919
873
  provide: HTTP_INTERCEPTORS,
920
874
  useClass: AuthorizationInterceptor,
@@ -933,27 +887,27 @@ class AuthenticationModule {
933
887
  ngModule: AuthenticationModule
934
888
  };
935
889
  }
890
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthenticationModule, deps: [{ token: i4.JwtModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
891
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: AuthenticationModule, declarations: [AuthenticationComponent,
892
+ DirectLoginComponent,
893
+ TimeoutNotificationComponent], imports: [CommonModule,
894
+ HttpClientModule,
895
+ //JwtModule,
896
+ RouterModule,
897
+ FormsModule,
898
+ ReactiveFormsModule,
899
+ CoolStorageModule], exports: [AuthenticationComponent,
900
+ DirectLoginComponent,
901
+ TimeoutNotificationComponent] }); }
902
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthenticationModule, imports: [CommonModule,
903
+ HttpClientModule,
904
+ //JwtModule,
905
+ RouterModule,
906
+ FormsModule,
907
+ ReactiveFormsModule,
908
+ CoolStorageModule] }); }
936
909
  }
937
- AuthenticationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationModule, deps: [{ token: i4.JwtModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
938
- AuthenticationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationModule, declarations: [AuthenticationComponent,
939
- DirectLoginComponent,
940
- TimeoutNotificationComponent], imports: [CommonModule,
941
- HttpClientModule,
942
- //JwtModule,
943
- RouterModule,
944
- FormsModule,
945
- ReactiveFormsModule,
946
- CoolStorageModule], exports: [AuthenticationComponent,
947
- DirectLoginComponent,
948
- TimeoutNotificationComponent] });
949
- AuthenticationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationModule, imports: [CommonModule,
950
- HttpClientModule,
951
- //JwtModule,
952
- RouterModule,
953
- FormsModule,
954
- ReactiveFormsModule,
955
- CoolStorageModule] });
956
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthenticationModule, decorators: [{
910
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthenticationModule, decorators: [{
957
911
  type: NgModule,
958
912
  args: [{
959
913
  imports: [
@@ -982,6 +936,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
982
936
  type: SkipSelf
983
937
  }] }]; } });
984
938
 
939
+ /*
940
+ * Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
941
+ */
942
+ const RouteGuardService = () => {
943
+ const authenticationService = inject(AuthenticationService);
944
+ const router = inject(Router);
945
+ const state = inject(RouterStateSnapshot);
946
+ const authenticationRoute = inject(AUTHENTICATION_ROUTE);
947
+ if (authenticationService.isAuthenticated()) {
948
+ return true;
949
+ }
950
+ else {
951
+ // Store the attempted URL for redirecting
952
+ authenticationService.redirectUrl = state.url;
953
+ // Navigate to the login page
954
+ return router.navigate([authenticationRoute]);
955
+ }
956
+ };
957
+
985
958
  /**
986
959
  * Generated bundle index. Do not edit.
987
960
  */