@igo2/auth 16.0.1 → 16.1.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.
- package/esm2022/lib/auth-form/auth-facebook.component.mjs +9 -11
- package/esm2022/lib/auth-form/auth-form.component.mjs +21 -148
- package/esm2022/lib/auth-form/auth-google.component.mjs +9 -11
- package/esm2022/lib/auth-form/auth-intern.component.mjs +11 -75
- package/esm2022/lib/auth-form/auth-microsoft.component.mjs +12 -22
- package/esm2022/lib/auth-form/auth-microsoftb2c.component.mjs +12 -22
- package/esm2022/lib/auth-monitoring/auth-monitoring.provider.mjs +23 -0
- package/esm2022/lib/auth-monitoring/auth-monitoring.service.mjs +53 -0
- package/esm2022/lib/auth-routing.module.mjs +12 -13
- package/esm2022/lib/auth.module.mjs +43 -44
- package/esm2022/lib/shared/admin.guard.mjs +10 -11
- package/esm2022/lib/shared/auth-msalBroadcastServiceb2c.service.mjs +9 -9
- package/esm2022/lib/shared/auth-msalServiceb2c.service..mjs +9 -9
- package/esm2022/lib/shared/auth-storage.interface.mjs +2 -0
- package/esm2022/lib/shared/auth-storage.service.mjs +99 -0
- package/esm2022/lib/shared/auth.guard.mjs +9 -9
- package/esm2022/lib/shared/auth.interceptor.mjs +10 -13
- package/esm2022/lib/shared/auth.interface.mjs +1 -1
- package/esm2022/lib/shared/auth.service.mjs +18 -14
- package/esm2022/lib/shared/index.mjs +4 -3
- package/esm2022/lib/shared/logged.guard.mjs +9 -9
- package/esm2022/lib/shared/profils.guard.mjs +9 -9
- package/esm2022/lib/shared/protected.directive.mjs +9 -9
- package/esm2022/lib/shared/token.interface.mjs +2 -0
- package/esm2022/lib/shared/token.service.mjs +10 -10
- package/esm2022/public_api.mjs +6 -3
- package/fesm2022/igo2-auth.mjs +291 -441
- package/fesm2022/igo2-auth.mjs.map +1 -1
- package/lib/auth-monitoring/auth-monitoring.provider.d.ts +3 -0
- package/lib/auth-monitoring/auth-monitoring.service.d.ts +14 -0
- package/lib/shared/{storage.service.d.ts → auth-storage.service.d.ts} +1 -1
- package/lib/shared/auth.interface.d.ts +3 -5
- package/lib/shared/auth.service.d.ts +3 -1
- package/lib/shared/index.d.ts +3 -2
- package/lib/shared/token.interface.d.ts +5 -0
- package/lib/shared/token.service.d.ts +2 -1
- package/package.json +20 -22
- package/public_api.d.ts +5 -2
- package/esm2022/lib/shared/storage.interface.mjs +0 -2
- package/esm2022/lib/shared/storage.service.mjs +0 -99
- /package/lib/shared/{storage.interface.d.ts → auth-storage.interface.d.ts} +0 -0
package/fesm2022/igo2-auth.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Optional, EventEmitter, Component, ChangeDetectionStrategy, Output, Input, Inject, Directive, NgModule } from '@angular/core';
|
|
2
|
+
import { Injectable, Optional, EventEmitter, Component, ChangeDetectionStrategy, Output, Input, Inject, Directive, Injector, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
3
3
|
import * as i3 from '@angular/router';
|
|
4
4
|
import { NavigationStart, RouterModule } from '@angular/router';
|
|
5
5
|
import * as i2 from '@igo2/core';
|
|
6
|
-
import { ConfigService, BaseStorage, StorageScope, StorageService, IgoLanguageModule } from '@igo2/core';
|
|
6
|
+
import { ConfigService, BaseStorage, StorageScope, identifySentryUser, MONITORING_OPTIONS, StorageService, IgoLanguageModule } from '@igo2/core';
|
|
7
7
|
import { tap, catchError, filter, takeUntil, map } from 'rxjs/operators';
|
|
8
8
|
import * as i1 from '@angular/common/http';
|
|
9
9
|
import { HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
10
10
|
import { Base64 } from '@igo2/utils';
|
|
11
|
-
import { BehaviorSubject, of, Subject, from } from 'rxjs';
|
|
11
|
+
import { BehaviorSubject, of, Subject, from, first, switchMap } from 'rxjs';
|
|
12
12
|
import { globalCacheBusterNotifier } from 'ts-cacheable';
|
|
13
|
-
import jwtDecode from 'jwt-decode';
|
|
13
|
+
import { jwtDecode } from 'jwt-decode';
|
|
14
14
|
import * as i1$1 from '@angular/common';
|
|
15
15
|
import { CommonModule } from '@angular/common';
|
|
16
16
|
import * as i5$1 from '@angular/material/button';
|
|
@@ -63,15 +63,15 @@ class TokenService {
|
|
|
63
63
|
}
|
|
64
64
|
return true;
|
|
65
65
|
}
|
|
66
|
-
static ɵfac =
|
|
67
|
-
static ɵprov =
|
|
66
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TokenService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
67
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TokenService, providedIn: 'root' });
|
|
68
68
|
}
|
|
69
|
-
(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TokenService, decorators: [{
|
|
70
|
+
type: Injectable,
|
|
71
|
+
args: [{
|
|
72
|
+
providedIn: 'root'
|
|
73
|
+
}]
|
|
74
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
75
75
|
|
|
76
76
|
class AuthService {
|
|
77
77
|
http;
|
|
@@ -89,6 +89,10 @@ class AuthService {
|
|
|
89
89
|
get hasAuthService() {
|
|
90
90
|
return this.authOptions?.url !== undefined;
|
|
91
91
|
}
|
|
92
|
+
get user() {
|
|
93
|
+
const decodedToken = this.decodeToken();
|
|
94
|
+
return decodedToken?.user ? decodedToken.user : null;
|
|
95
|
+
}
|
|
92
96
|
constructor(http, tokenService, config, languageService, messageService, router) {
|
|
93
97
|
this.http = http;
|
|
94
98
|
this.tokenService = tokenService;
|
|
@@ -149,7 +153,7 @@ class AuthService {
|
|
|
149
153
|
if (this.isAuthenticated()) {
|
|
150
154
|
return this.tokenService.decode();
|
|
151
155
|
}
|
|
152
|
-
return
|
|
156
|
+
return;
|
|
153
157
|
}
|
|
154
158
|
goToRedirectUrl() {
|
|
155
159
|
if (!this.router) {
|
|
@@ -189,7 +193,7 @@ class AuthService {
|
|
|
189
193
|
}
|
|
190
194
|
get isAdmin() {
|
|
191
195
|
const token = this.decodeToken();
|
|
192
|
-
if (token
|
|
196
|
+
if (token?.user?.isAdmin) {
|
|
193
197
|
return true;
|
|
194
198
|
}
|
|
195
199
|
return false;
|
|
@@ -200,7 +204,7 @@ class AuthService {
|
|
|
200
204
|
.pipe(tap((data) => {
|
|
201
205
|
this.tokenService.set(data.token);
|
|
202
206
|
const tokenDecoded = this.decodeToken();
|
|
203
|
-
if (tokenDecoded
|
|
207
|
+
if (tokenDecoded?.user) {
|
|
204
208
|
if (tokenDecoded.user.locale && !this.languageForce) {
|
|
205
209
|
this.languageService.setLanguage(tokenDecoded.user.locale);
|
|
206
210
|
}
|
|
@@ -214,17 +218,17 @@ class AuthService {
|
|
|
214
218
|
throw err;
|
|
215
219
|
}));
|
|
216
220
|
}
|
|
217
|
-
static ɵfac =
|
|
218
|
-
static ɵprov =
|
|
221
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthService, deps: [{ token: i1.HttpClient }, { token: TokenService }, { token: i2.ConfigService }, { token: i2.LanguageService }, { token: i2.MessageService }, { token: i3.Router, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
222
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthService, providedIn: 'root' });
|
|
219
223
|
}
|
|
220
|
-
(
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthService, decorators: [{
|
|
225
|
+
type: Injectable,
|
|
226
|
+
args: [{
|
|
227
|
+
providedIn: 'root'
|
|
228
|
+
}]
|
|
229
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: TokenService }, { type: i2.ConfigService }, { type: i2.LanguageService }, { type: i2.MessageService }, { type: i3.Router, decorators: [{
|
|
230
|
+
type: Optional
|
|
231
|
+
}] }]; } });
|
|
228
232
|
|
|
229
233
|
class AuthGoogleComponent {
|
|
230
234
|
authService;
|
|
@@ -316,42 +320,16 @@ class AuthGoogleComponent {
|
|
|
316
320
|
js.src = 'https://apis.google.com/js/platform.js';
|
|
317
321
|
fjs.parentNode.insertBefore(js, fjs);
|
|
318
322
|
}
|
|
319
|
-
static ɵfac =
|
|
320
|
-
static ɵcmp =
|
|
321
|
-
i0.ɵɵelement(0, "div", 0);
|
|
322
|
-
} }, styles: ["[_nghost-%COMP%]{padding:10px 10px 10px 0;display:inline-block}.google-login-button[_ngcontent-%COMP%] .abcRioButton{color:#000000de}"], changeDetection: 0 });
|
|
323
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthGoogleComponent, deps: [{ token: AuthService }, { token: i2.ConfigService }, { token: i2.LanguageService }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
324
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AuthGoogleComponent, selector: "igo-auth-google", outputs: { login: "login" }, ngImport: i0, template: "<div\r\n class=\"g-signin2 google-login-button\"\r\n data-height=\"40\"\r\n data-width=\"265\"\r\n data-longtitle=\"true\"\r\n></div>\r\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block}.google-login-button ::ng-deep .abcRioButton{color:#000000de}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
323
325
|
}
|
|
324
|
-
(
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
326
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthGoogleComponent, decorators: [{
|
|
327
|
+
type: Component,
|
|
328
|
+
args: [{ selector: 'igo-auth-google', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"g-signin2 google-login-button\"\r\n data-height=\"40\"\r\n data-width=\"265\"\r\n data-longtitle=\"true\"\r\n></div>\r\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block}.google-login-button ::ng-deep .abcRioButton{color:#000000de}\n"] }]
|
|
329
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i2.LanguageService }, { type: i0.ApplicationRef }]; }, propDecorators: { login: [{
|
|
330
|
+
type: Output
|
|
331
|
+
}] } });
|
|
330
332
|
|
|
331
|
-
function AuthInternComponent_button_18_Template(rf, ctx) { if (rf & 1) {
|
|
332
|
-
const _r3 = i0.ɵɵgetCurrentView();
|
|
333
|
-
i0.ɵɵelementStart(0, "button", 7);
|
|
334
|
-
i0.ɵɵlistener("click", function AuthInternComponent_button_18_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.loginAnonymous()); });
|
|
335
|
-
i0.ɵɵtext(1);
|
|
336
|
-
i0.ɵɵpipe(2, "translate");
|
|
337
|
-
i0.ɵɵelementEnd();
|
|
338
|
-
} if (rf & 2) {
|
|
339
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
|
340
|
-
i0.ɵɵproperty("disabled", ctx_r0.loading);
|
|
341
|
-
i0.ɵɵadvance(1);
|
|
342
|
-
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2, "igo.auth.accessAnonymous"), " ");
|
|
343
|
-
} }
|
|
344
|
-
function AuthInternComponent_div_19_Template(rf, ctx) { if (rf & 1) {
|
|
345
|
-
i0.ɵɵelementStart(0, "div");
|
|
346
|
-
i0.ɵɵelement(1, "br");
|
|
347
|
-
i0.ɵɵelementStart(2, "font", 8);
|
|
348
|
-
i0.ɵɵtext(3);
|
|
349
|
-
i0.ɵɵelementEnd()();
|
|
350
|
-
} if (rf & 2) {
|
|
351
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
352
|
-
i0.ɵɵadvance(3);
|
|
353
|
-
i0.ɵɵtextInterpolate(ctx_r1.error);
|
|
354
|
-
} }
|
|
355
333
|
class AuthInternComponent {
|
|
356
334
|
auth;
|
|
357
335
|
languageService;
|
|
@@ -397,57 +375,17 @@ class AuthInternComponent {
|
|
|
397
375
|
this.login.emit(true);
|
|
398
376
|
});
|
|
399
377
|
}
|
|
400
|
-
static ɵfac =
|
|
401
|
-
static ɵcmp =
|
|
402
|
-
i0.ɵɵelementStart(0, "form", 0);
|
|
403
|
-
i0.ɵɵlistener("ngSubmit", function AuthInternComponent_Template_form_ngSubmit_0_listener() { return ctx.loginUser(ctx.form.value); });
|
|
404
|
-
i0.ɵɵelementStart(1, "div")(2, "mat-form-field", 1)(3, "mat-label");
|
|
405
|
-
i0.ɵɵtext(4);
|
|
406
|
-
i0.ɵɵpipe(5, "translate");
|
|
407
|
-
i0.ɵɵelementEnd();
|
|
408
|
-
i0.ɵɵelement(6, "input", 2);
|
|
409
|
-
i0.ɵɵpipe(7, "translate");
|
|
410
|
-
i0.ɵɵelementEnd()();
|
|
411
|
-
i0.ɵɵelementStart(8, "div")(9, "mat-form-field", 1)(10, "mat-label");
|
|
412
|
-
i0.ɵɵtext(11);
|
|
413
|
-
i0.ɵɵpipe(12, "translate");
|
|
414
|
-
i0.ɵɵelementEnd();
|
|
415
|
-
i0.ɵɵelement(13, "input", 3);
|
|
416
|
-
i0.ɵɵpipe(14, "translate");
|
|
417
|
-
i0.ɵɵelementEnd()();
|
|
418
|
-
i0.ɵɵelementStart(15, "button", 4);
|
|
419
|
-
i0.ɵɵtext(16);
|
|
420
|
-
i0.ɵɵpipe(17, "translate");
|
|
421
|
-
i0.ɵɵelementEnd();
|
|
422
|
-
i0.ɵɵtemplate(18, AuthInternComponent_button_18_Template, 3, 4, "button", 5);
|
|
423
|
-
i0.ɵɵtemplate(19, AuthInternComponent_div_19_Template, 4, 1, "div", 6);
|
|
424
|
-
i0.ɵɵelementEnd();
|
|
425
|
-
} if (rf & 2) {
|
|
426
|
-
i0.ɵɵproperty("formGroup", ctx.form);
|
|
427
|
-
i0.ɵɵadvance(4);
|
|
428
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(5, 8, "igo.auth.user"));
|
|
429
|
-
i0.ɵɵadvance(2);
|
|
430
|
-
i0.ɵɵpropertyInterpolate("placeholder", i0.ɵɵpipeBind1(7, 10, "igo.auth.user"));
|
|
431
|
-
i0.ɵɵadvance(5);
|
|
432
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(12, 12, "igo.auth.password"));
|
|
433
|
-
i0.ɵɵadvance(2);
|
|
434
|
-
i0.ɵɵpropertyInterpolate("placeholder", i0.ɵɵpipeBind1(14, 14, "igo.auth.password"));
|
|
435
|
-
i0.ɵɵadvance(3);
|
|
436
|
-
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(17, 16, "igo.auth.login"), " ");
|
|
437
|
-
i0.ɵɵadvance(2);
|
|
438
|
-
i0.ɵɵproperty("ngIf", ctx.allowAnonymous);
|
|
439
|
-
i0.ɵɵadvance(1);
|
|
440
|
-
i0.ɵɵproperty("ngIf", ctx.error);
|
|
441
|
-
} }, dependencies: [i1$1.NgIf, i3$1.ɵNgNoValidate, i3$1.DefaultValueAccessor, i3$1.NgControlStatus, i3$1.NgControlStatusGroup, i3$1.RequiredValidator, i3$1.FormGroupDirective, i3$1.FormControlName, i5.MatFormField, i5.MatLabel, i6.MatInput, i5$1.MatButton, i6$1.TranslatePipe], styles: [".full-width[_ngcontent-%COMP%]{width:100%}.anonymous[_ngcontent-%COMP%]{margin-left:10px}"] });
|
|
378
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthInternComponent, deps: [{ token: AuthService }, { token: i2.LanguageService }, { token: i3$1.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
379
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AuthInternComponent, selector: "igo-auth-intern", inputs: { allowAnonymous: "allowAnonymous" }, outputs: { login: "login" }, ngImport: i0, template: "<form [formGroup]=\"form\" role=\"form\" (ngSubmit)=\"loginUser(form.value)\">\r\n <div>\r\n <mat-form-field class=\"full-width\">\r\n <mat-label>{{ 'igo.auth.user' | translate }}</mat-label>\r\n <input\r\n matInput\r\n required\r\n placeholder=\"{{ 'igo.auth.user' | translate }}\"\r\n formControlName=\"username\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field class=\"full-width\">\r\n <mat-label>{{ 'igo.auth.password' | translate }}</mat-label>\r\n <input\r\n matInput\r\n required\r\n type=\"password\"\r\n placeholder=\"{{ 'igo.auth.password' | translate }}\"\r\n formControlName=\"password\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <button mat-raised-button type=\"submit\">\r\n {{ 'igo.auth.login' | translate }}\r\n </button>\r\n <button\r\n *ngIf=\"allowAnonymous\"\r\n mat-raised-button\r\n class=\"anonymous\"\r\n type=\"button\"\r\n [disabled]=\"loading\"\r\n (click)=\"loginAnonymous()\"\r\n >\r\n {{ 'igo.auth.accessAnonymous' | translate }}\r\n </button>\r\n <div *ngIf=\"error\">\r\n <br />\r\n <font size=\"3\" color=\"red\">{{ error }}</font>\r\n </div>\r\n</form>\r\n", styles: [".full-width{width:100%}.anonymous{margin-left:10px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.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: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: i6$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
442
380
|
}
|
|
443
|
-
(
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
381
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthInternComponent, decorators: [{
|
|
382
|
+
type: Component,
|
|
383
|
+
args: [{ selector: 'igo-auth-intern', changeDetection: ChangeDetectionStrategy.Default, template: "<form [formGroup]=\"form\" role=\"form\" (ngSubmit)=\"loginUser(form.value)\">\r\n <div>\r\n <mat-form-field class=\"full-width\">\r\n <mat-label>{{ 'igo.auth.user' | translate }}</mat-label>\r\n <input\r\n matInput\r\n required\r\n placeholder=\"{{ 'igo.auth.user' | translate }}\"\r\n formControlName=\"username\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field class=\"full-width\">\r\n <mat-label>{{ 'igo.auth.password' | translate }}</mat-label>\r\n <input\r\n matInput\r\n required\r\n type=\"password\"\r\n placeholder=\"{{ 'igo.auth.password' | translate }}\"\r\n formControlName=\"password\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <button mat-raised-button type=\"submit\">\r\n {{ 'igo.auth.login' | translate }}\r\n </button>\r\n <button\r\n *ngIf=\"allowAnonymous\"\r\n mat-raised-button\r\n class=\"anonymous\"\r\n type=\"button\"\r\n [disabled]=\"loading\"\r\n (click)=\"loginAnonymous()\"\r\n >\r\n {{ 'igo.auth.accessAnonymous' | translate }}\r\n </button>\r\n <div *ngIf=\"error\">\r\n <br />\r\n <font size=\"3\" color=\"red\">{{ error }}</font>\r\n </div>\r\n</form>\r\n", styles: [".full-width{width:100%}.anonymous{margin-left:10px}\n"] }]
|
|
384
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: i2.LanguageService }, { type: i3$1.UntypedFormBuilder }]; }, propDecorators: { allowAnonymous: [{
|
|
385
|
+
type: Input
|
|
386
|
+
}], login: [{
|
|
387
|
+
type: Output
|
|
388
|
+
}] } });
|
|
451
389
|
|
|
452
390
|
class AuthFacebookComponent {
|
|
453
391
|
authService;
|
|
@@ -498,17 +436,15 @@ class AuthFacebookComponent {
|
|
|
498
436
|
};
|
|
499
437
|
fjs.parentNode.insertBefore(js, fjs);
|
|
500
438
|
}
|
|
501
|
-
static ɵfac =
|
|
502
|
-
static ɵcmp =
|
|
503
|
-
i0.ɵɵelement(0, "div", 0);
|
|
504
|
-
} }, styles: ["[_nghost-%COMP%]{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-3px}"], changeDetection: 0 });
|
|
439
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthFacebookComponent, deps: [{ token: AuthService }, { token: i2.ConfigService }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
440
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AuthFacebookComponent, selector: "igo-auth-facebook", outputs: { login: "login" }, ngImport: i0, template: "<div\r\n scope=\"public_profile,email\"\r\n class=\"fb-login-button\"\r\n data-max-rows=\"1\"\r\n data-size=\"large\"\r\n data-button-type=\"login_with\"\r\n data-show-faces=\"false\"\r\n data-auto-logout-link=\"false\"\r\n data-use-continue-as=\"false\"\r\n></div>\r\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-3px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
505
441
|
}
|
|
506
|
-
(
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
442
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthFacebookComponent, decorators: [{
|
|
443
|
+
type: Component,
|
|
444
|
+
args: [{ selector: 'igo-auth-facebook', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n scope=\"public_profile,email\"\r\n class=\"fb-login-button\"\r\n data-max-rows=\"1\"\r\n data-size=\"large\"\r\n data-button-type=\"login_with\"\r\n data-show-faces=\"false\"\r\n data-auto-logout-link=\"false\"\r\n data-use-continue-as=\"false\"\r\n></div>\r\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-3px}\n"] }]
|
|
445
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }]; }, propDecorators: { login: [{
|
|
446
|
+
type: Output
|
|
447
|
+
}] } });
|
|
512
448
|
|
|
513
449
|
class AuthMicrosoftComponent {
|
|
514
450
|
authService;
|
|
@@ -580,28 +516,18 @@ class AuthMicrosoftComponent {
|
|
|
580
516
|
getConf() {
|
|
581
517
|
return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];
|
|
582
518
|
}
|
|
583
|
-
static ɵfac =
|
|
584
|
-
static ɵcmp =
|
|
585
|
-
i0.ɵɵelementStart(0, "button", 0);
|
|
586
|
-
i0.ɵɵlistener("click", function AuthMicrosoftComponent_Template_button_click_0_listener() { return ctx.loginMicrosoft(); });
|
|
587
|
-
i0.ɵɵelement(1, "mat-icon", 1);
|
|
588
|
-
i0.ɵɵtext(2);
|
|
589
|
-
i0.ɵɵpipe(3, "translate");
|
|
590
|
-
i0.ɵɵelementEnd();
|
|
591
|
-
} if (rf & 2) {
|
|
592
|
-
i0.ɵɵadvance(2);
|
|
593
|
-
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 1, "igo.auth.microsoft.login"), "\n");
|
|
594
|
-
} }, dependencies: [i4.MatIcon, i5$1.MatButton, i6$1.TranslatePipe], styles: ["[_nghost-%COMP%]{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}[_nghost-%COMP%] > button[_ngcontent-%COMP%]{font-size:15px;height:40px;width:265px}mat-icon[_ngcontent-%COMP%]{margin-right:10px}"], changeDetection: 0 });
|
|
519
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthMicrosoftComponent, deps: [{ token: AuthService }, { token: i2.ConfigService }, { token: i0.ApplicationRef }, { token: i3$2.MsalService }, { token: MSAL_GUARD_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
520
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AuthMicrosoftComponent, selector: "igo-auth-microsoft", outputs: { login: "login" }, ngImport: i0, template: "<button\r\n class=\"microsoft-login-button\"\r\n mat-raised-button\r\n (click)=\"loginMicrosoft()\"\r\n>\r\n <mat-icon svgIcon=\"microsoft\"></mat-icon>\r\n {{ 'igo.auth.microsoft.login' | translate }}\r\n</button>\r\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}:host>button{font-size:15px;height:40px;width:265px}mat-icon{margin-right:10px}\n"], dependencies: [{ kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: i6$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
595
521
|
}
|
|
596
|
-
(
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
522
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthMicrosoftComponent, decorators: [{
|
|
523
|
+
type: Component,
|
|
524
|
+
args: [{ selector: 'igo-auth-microsoft', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\r\n class=\"microsoft-login-button\"\r\n mat-raised-button\r\n (click)=\"loginMicrosoft()\"\r\n>\r\n <mat-icon svgIcon=\"microsoft\"></mat-icon>\r\n {{ 'igo.auth.microsoft.login' | translate }}\r\n</button>\r\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}:host>button{font-size:15px;height:40px;width:265px}mat-icon{margin-right:10px}\n"] }]
|
|
525
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }, { type: i3$2.MsalService }, { type: undefined, decorators: [{
|
|
526
|
+
type: Inject,
|
|
527
|
+
args: [MSAL_GUARD_CONFIG]
|
|
528
|
+
}] }]; }, propDecorators: { login: [{
|
|
529
|
+
type: Output
|
|
530
|
+
}] } });
|
|
605
531
|
|
|
606
532
|
/*
|
|
607
533
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -671,15 +597,15 @@ class MsalServiceb2c {
|
|
|
671
597
|
this.logger = logger.clone(this.name, this.version);
|
|
672
598
|
this.instance.setLogger(logger);
|
|
673
599
|
}
|
|
674
|
-
static ɵfac =
|
|
675
|
-
static ɵprov =
|
|
600
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MsalServiceb2c, deps: [{ token: MSAL_INSTANCE }, { token: i1$1.Location }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
601
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MsalServiceb2c });
|
|
676
602
|
}
|
|
677
|
-
(
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MsalServiceb2c, decorators: [{
|
|
604
|
+
type: Injectable
|
|
605
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
606
|
+
type: Inject,
|
|
607
|
+
args: [MSAL_INSTANCE]
|
|
608
|
+
}] }, { type: i1$1.Location }]; } });
|
|
683
609
|
|
|
684
610
|
/*
|
|
685
611
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -711,15 +637,15 @@ class MsalBroadcastServiceb2c {
|
|
|
711
637
|
}
|
|
712
638
|
});
|
|
713
639
|
}
|
|
714
|
-
static ɵfac =
|
|
715
|
-
static ɵprov =
|
|
640
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MsalBroadcastServiceb2c, deps: [{ token: MSAL_INSTANCE }, { token: MsalServiceb2c }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
641
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MsalBroadcastServiceb2c });
|
|
716
642
|
}
|
|
717
|
-
(
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MsalBroadcastServiceb2c, decorators: [{
|
|
644
|
+
type: Injectable
|
|
645
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
646
|
+
type: Inject,
|
|
647
|
+
args: [MSAL_INSTANCE]
|
|
648
|
+
}] }, { type: MsalServiceb2c }]; } });
|
|
723
649
|
|
|
724
650
|
class AuthMicrosoftb2cComponent {
|
|
725
651
|
authService;
|
|
@@ -787,152 +713,19 @@ class AuthMicrosoftb2cComponent {
|
|
|
787
713
|
getConf() {
|
|
788
714
|
return this.msalGuardConfig.filter((conf) => conf.type === 'b2c')[0];
|
|
789
715
|
}
|
|
790
|
-
static ɵfac =
|
|
791
|
-
static ɵcmp =
|
|
792
|
-
i0.ɵɵelementStart(0, "button", 0);
|
|
793
|
-
i0.ɵɵlistener("click", function AuthMicrosoftb2cComponent_Template_button_click_0_listener() { return ctx.loginMicrosoftb2c(); });
|
|
794
|
-
i0.ɵɵelement(1, "mat-icon", 1);
|
|
795
|
-
i0.ɵɵtext(2);
|
|
796
|
-
i0.ɵɵpipe(3, "translate");
|
|
797
|
-
i0.ɵɵelementEnd();
|
|
798
|
-
} if (rf & 2) {
|
|
799
|
-
i0.ɵɵadvance(2);
|
|
800
|
-
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 1, "igo.auth.microsoftb2c.login"), "\n");
|
|
801
|
-
} }, dependencies: [i4.MatIcon, i5$1.MatButton, i6$1.TranslatePipe], styles: ["[_nghost-%COMP%]{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}[_nghost-%COMP%] > button[_ngcontent-%COMP%]{font-size:15px;height:40px;width:265px}mat-icon[_ngcontent-%COMP%]{margin-right:10px}"], changeDetection: 0 });
|
|
716
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthMicrosoftb2cComponent, deps: [{ token: AuthService }, { token: i2.ConfigService }, { token: i0.ApplicationRef }, { token: MsalServiceb2c }, { token: MSAL_GUARD_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
717
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AuthMicrosoftb2cComponent, selector: "igo-auth-microsoftb2c", outputs: { login: "login" }, ngImport: i0, template: "<button\r\n class=\"microsoft-login-button\"\r\n mat-raised-button\r\n (click)=\"loginMicrosoftb2c()\"\r\n>\r\n <mat-icon svgIcon=\"microsoft\"></mat-icon>\r\n {{ 'igo.auth.microsoftb2c.login' | translate }}\r\n</button>\r\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}:host>button{font-size:15px;height:40px;width:265px}mat-icon{margin-right:10px}\n"], dependencies: [{ kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: i6$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
802
718
|
}
|
|
803
|
-
(
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
719
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthMicrosoftb2cComponent, decorators: [{
|
|
720
|
+
type: Component,
|
|
721
|
+
args: [{ selector: 'igo-auth-microsoftb2c', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\r\n class=\"microsoft-login-button\"\r\n mat-raised-button\r\n (click)=\"loginMicrosoftb2c()\"\r\n>\r\n <mat-icon svgIcon=\"microsoft\"></mat-icon>\r\n {{ 'igo.auth.microsoftb2c.login' | translate }}\r\n</button>\r\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}:host>button{font-size:15px;height:40px;width:265px}mat-icon{margin-right:10px}\n"] }]
|
|
722
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }, { type: MsalServiceb2c }, { type: undefined, decorators: [{
|
|
723
|
+
type: Inject,
|
|
724
|
+
args: [MSAL_GUARD_CONFIG]
|
|
725
|
+
}] }]; }, propDecorators: { login: [{
|
|
726
|
+
type: Output
|
|
727
|
+
}] } });
|
|
812
728
|
|
|
813
|
-
function AuthFormComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
814
|
-
i0.ɵɵelement(0, "div", 3);
|
|
815
|
-
} }
|
|
816
|
-
function AuthFormComponent_div_0_div_2_igo_auth_google_4_Template(rf, ctx) { if (rf & 1) {
|
|
817
|
-
const _r11 = i0.ɵɵgetCurrentView();
|
|
818
|
-
i0.ɵɵelementStart(0, "igo-auth-google", 7);
|
|
819
|
-
i0.ɵɵlistener("login", function AuthFormComponent_div_0_div_2_igo_auth_google_4_Template_igo_auth_google_login_0_listener() { i0.ɵɵrestoreView(_r11); const ctx_r10 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r10.onLogin()); });
|
|
820
|
-
i0.ɵɵelementEnd();
|
|
821
|
-
} }
|
|
822
|
-
function AuthFormComponent_div_0_div_2_igo_auth_microsoft_5_Template(rf, ctx) { if (rf & 1) {
|
|
823
|
-
const _r13 = i0.ɵɵgetCurrentView();
|
|
824
|
-
i0.ɵɵelementStart(0, "igo-auth-microsoft", 7);
|
|
825
|
-
i0.ɵɵlistener("login", function AuthFormComponent_div_0_div_2_igo_auth_microsoft_5_Template_igo_auth_microsoft_login_0_listener() { i0.ɵɵrestoreView(_r13); const ctx_r12 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r12.onLogin()); });
|
|
826
|
-
i0.ɵɵelementEnd();
|
|
827
|
-
} }
|
|
828
|
-
function AuthFormComponent_div_0_div_2_igo_auth_microsoftb2c_6_Template(rf, ctx) { if (rf & 1) {
|
|
829
|
-
const _r15 = i0.ɵɵgetCurrentView();
|
|
830
|
-
i0.ɵɵelementStart(0, "igo-auth-microsoftb2c", 7);
|
|
831
|
-
i0.ɵɵlistener("login", function AuthFormComponent_div_0_div_2_igo_auth_microsoftb2c_6_Template_igo_auth_microsoftb2c_login_0_listener() { i0.ɵɵrestoreView(_r15); const ctx_r14 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r14.onLogin()); });
|
|
832
|
-
i0.ɵɵelementEnd();
|
|
833
|
-
} }
|
|
834
|
-
function AuthFormComponent_div_0_div_2_igo_auth_facebook_7_Template(rf, ctx) { if (rf & 1) {
|
|
835
|
-
const _r17 = i0.ɵɵgetCurrentView();
|
|
836
|
-
i0.ɵɵelementStart(0, "igo-auth-facebook", 7);
|
|
837
|
-
i0.ɵɵlistener("login", function AuthFormComponent_div_0_div_2_igo_auth_facebook_7_Template_igo_auth_facebook_login_0_listener() { i0.ɵɵrestoreView(_r17); const ctx_r16 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r16.onLogin()); });
|
|
838
|
-
i0.ɵɵelementEnd();
|
|
839
|
-
} }
|
|
840
|
-
function AuthFormComponent_div_0_div_2_igo_auth_intern_8_Template(rf, ctx) { if (rf & 1) {
|
|
841
|
-
const _r19 = i0.ɵɵgetCurrentView();
|
|
842
|
-
i0.ɵɵelementStart(0, "igo-auth-intern", 8);
|
|
843
|
-
i0.ɵɵlistener("login", function AuthFormComponent_div_0_div_2_igo_auth_intern_8_Template_igo_auth_intern_login_0_listener() { i0.ɵɵrestoreView(_r19); const ctx_r18 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r18.onLogin()); });
|
|
844
|
-
i0.ɵɵelementEnd();
|
|
845
|
-
} if (rf & 2) {
|
|
846
|
-
const ctx_r9 = i0.ɵɵnextContext(3);
|
|
847
|
-
i0.ɵɵproperty("allowAnonymous", ctx_r9.options.allowAnonymous);
|
|
848
|
-
} }
|
|
849
|
-
function AuthFormComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
850
|
-
i0.ɵɵelementStart(0, "div", 4)(1, "h1");
|
|
851
|
-
i0.ɵɵtext(2);
|
|
852
|
-
i0.ɵɵpipe(3, "translate");
|
|
853
|
-
i0.ɵɵelementEnd();
|
|
854
|
-
i0.ɵɵtemplate(4, AuthFormComponent_div_0_div_2_igo_auth_google_4_Template, 1, 0, "igo-auth-google", 5);
|
|
855
|
-
i0.ɵɵtemplate(5, AuthFormComponent_div_0_div_2_igo_auth_microsoft_5_Template, 1, 0, "igo-auth-microsoft", 5);
|
|
856
|
-
i0.ɵɵtemplate(6, AuthFormComponent_div_0_div_2_igo_auth_microsoftb2c_6_Template, 1, 0, "igo-auth-microsoftb2c", 5);
|
|
857
|
-
i0.ɵɵtemplate(7, AuthFormComponent_div_0_div_2_igo_auth_facebook_7_Template, 1, 0, "igo-auth-facebook", 5);
|
|
858
|
-
i0.ɵɵtemplate(8, AuthFormComponent_div_0_div_2_igo_auth_intern_8_Template, 1, 1, "igo-auth-intern", 6);
|
|
859
|
-
i0.ɵɵelementEnd();
|
|
860
|
-
} if (rf & 2) {
|
|
861
|
-
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
862
|
-
i0.ɵɵadvance(2);
|
|
863
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 6, "igo.auth.connection"));
|
|
864
|
-
i0.ɵɵadvance(2);
|
|
865
|
-
i0.ɵɵproperty("ngIf", ctx_r2.options.google && ctx_r2.options.google.enabled !== false);
|
|
866
|
-
i0.ɵɵadvance(1);
|
|
867
|
-
i0.ɵɵproperty("ngIf", ctx_r2.options.microsoft && ctx_r2.options.microsoft.enabled !== false);
|
|
868
|
-
i0.ɵɵadvance(1);
|
|
869
|
-
i0.ɵɵproperty("ngIf", ctx_r2.options.microsoftb2c && ctx_r2.options.microsoftb2c.enabled !== false);
|
|
870
|
-
i0.ɵɵadvance(1);
|
|
871
|
-
i0.ɵɵproperty("ngIf", ctx_r2.options.facebook && ctx_r2.options.facebook.enabled !== false);
|
|
872
|
-
i0.ɵɵadvance(1);
|
|
873
|
-
i0.ɵɵproperty("ngIf", !ctx_r2.options.intern || ctx_r2.options.intern.enabled !== false);
|
|
874
|
-
} }
|
|
875
|
-
function AuthFormComponent_div_0_div_3_Template(rf, ctx) { if (rf & 1) {
|
|
876
|
-
const _r21 = i0.ɵɵgetCurrentView();
|
|
877
|
-
i0.ɵɵelementStart(0, "div", 4)(1, "p");
|
|
878
|
-
i0.ɵɵtext(2);
|
|
879
|
-
i0.ɵɵpipe(3, "translate");
|
|
880
|
-
i0.ɵɵelementEnd();
|
|
881
|
-
i0.ɵɵelementStart(4, "button", 9);
|
|
882
|
-
i0.ɵɵlistener("click", function AuthFormComponent_div_0_div_3_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r21); const ctx_r20 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r20.logout()); });
|
|
883
|
-
i0.ɵɵtext(5);
|
|
884
|
-
i0.ɵɵpipe(6, "translate");
|
|
885
|
-
i0.ɵɵelementEnd()();
|
|
886
|
-
} if (rf & 2) {
|
|
887
|
-
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
888
|
-
i0.ɵɵadvance(2);
|
|
889
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(3, 2, "igo.auth.welcome", ctx_r3.user));
|
|
890
|
-
i0.ɵɵadvance(3);
|
|
891
|
-
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 5, "igo.auth.signOut"), " ");
|
|
892
|
-
} }
|
|
893
|
-
function AuthFormComponent_div_0_div_4_button_4_Template(rf, ctx) { if (rf & 1) {
|
|
894
|
-
const _r24 = i0.ɵɵgetCurrentView();
|
|
895
|
-
i0.ɵɵelementStart(0, "button", 9);
|
|
896
|
-
i0.ɵɵlistener("click", function AuthFormComponent_div_0_div_4_button_4_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r24); const ctx_r23 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r23.home()); });
|
|
897
|
-
i0.ɵɵtext(1);
|
|
898
|
-
i0.ɵɵpipe(2, "translate");
|
|
899
|
-
i0.ɵɵelementEnd();
|
|
900
|
-
} if (rf & 2) {
|
|
901
|
-
i0.ɵɵadvance(1);
|
|
902
|
-
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, "igo.auth.home"), " ");
|
|
903
|
-
} }
|
|
904
|
-
function AuthFormComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
|
|
905
|
-
i0.ɵɵelementStart(0, "div", 4)(1, "p");
|
|
906
|
-
i0.ɵɵtext(2);
|
|
907
|
-
i0.ɵɵpipe(3, "translate");
|
|
908
|
-
i0.ɵɵelementEnd();
|
|
909
|
-
i0.ɵɵtemplate(4, AuthFormComponent_div_0_div_4_button_4_Template, 3, 3, "button", 10);
|
|
910
|
-
i0.ɵɵelementEnd();
|
|
911
|
-
} if (rf & 2) {
|
|
912
|
-
const ctx_r4 = i0.ɵɵnextContext(2);
|
|
913
|
-
i0.ɵɵadvance(2);
|
|
914
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "igo.auth.deconnection"));
|
|
915
|
-
i0.ɵɵadvance(2);
|
|
916
|
-
i0.ɵɵproperty("ngIf", ctx_r4.options.homeRoute);
|
|
917
|
-
} }
|
|
918
|
-
function AuthFormComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
919
|
-
i0.ɵɵelementStart(0, "div");
|
|
920
|
-
i0.ɵɵtemplate(1, AuthFormComponent_div_0_div_1_Template, 1, 0, "div", 1);
|
|
921
|
-
i0.ɵɵtemplate(2, AuthFormComponent_div_0_div_2_Template, 9, 8, "div", 2);
|
|
922
|
-
i0.ɵɵtemplate(3, AuthFormComponent_div_0_div_3_Template, 7, 7, "div", 2);
|
|
923
|
-
i0.ɵɵtemplate(4, AuthFormComponent_div_0_div_4_Template, 5, 4, "div", 2);
|
|
924
|
-
i0.ɵɵelementEnd();
|
|
925
|
-
} if (rf & 2) {
|
|
926
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
|
927
|
-
i0.ɵɵadvance(1);
|
|
928
|
-
i0.ɵɵproperty("ngIf", !ctx_r0.auth.logged && ctx_r0.backgroundDisable);
|
|
929
|
-
i0.ɵɵadvance(1);
|
|
930
|
-
i0.ɵɵproperty("ngIf", !ctx_r0.auth.logged && ctx_r0.showLoginDiv);
|
|
931
|
-
i0.ɵɵadvance(1);
|
|
932
|
-
i0.ɵɵproperty("ngIf", ctx_r0.auth.logged && ctx_r0.showAlreadyConnectedDiv);
|
|
933
|
-
i0.ɵɵadvance(1);
|
|
934
|
-
i0.ɵɵproperty("ngIf", ctx_r0.showLogoutDiv);
|
|
935
|
-
} }
|
|
936
729
|
class AuthFormComponent {
|
|
937
730
|
auth;
|
|
938
731
|
config;
|
|
@@ -1053,31 +846,27 @@ class AuthFormComponent {
|
|
|
1053
846
|
}
|
|
1054
847
|
});
|
|
1055
848
|
}
|
|
1056
|
-
static ɵfac =
|
|
1057
|
-
static ɵcmp =
|
|
1058
|
-
i0.ɵɵtemplate(0, AuthFormComponent_div_0_Template, 5, 4, "div", 0);
|
|
1059
|
-
} if (rf & 2) {
|
|
1060
|
-
i0.ɵɵproperty("ngIf", ctx.visible);
|
|
1061
|
-
} }, dependencies: [i1$1.NgIf, i5$1.MatButton, AuthGoogleComponent, AuthInternComponent, AuthFacebookComponent, AuthMicrosoftComponent, AuthMicrosoftb2cComponent, i6$1.TranslatePipe], styles: ["[_nghost-%COMP%]{z-index:999}div.login[_ngcontent-%COMP%]{z-index:200;width:90%;min-width:360px;max-width:600px;padding:25px 50px;border:1px solid;background-color:#fff;border-color:#888}.center-block[_ngcontent-%COMP%]{position:fixed;top:20%;left:50%;transform:translate(-50%)}.backgroundDisable[_ngcontent-%COMP%]{position:fixed;top:0;left:0;background:#000;opacity:.8;z-index:100;height:100%;width:100%}"] });
|
|
849
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthFormComponent, deps: [{ token: AuthService }, { token: i2.ConfigService }, { token: i3.Router, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
850
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AuthFormComponent, selector: "igo-auth-form", inputs: { backgroundDisable: "backgroundDisable", hasAlreadyConnectedDiv: "hasAlreadyConnectedDiv", hasLogoutDiv: "hasLogoutDiv", showAlreadyConnectedDiv: "showAlreadyConnectedDiv", showLogoutDiv: "showLogoutDiv" }, outputs: { login: "login" }, ngImport: i0, template: "<div *ngIf=\"visible\">\r\n <div\r\n *ngIf=\"!auth.logged && backgroundDisable\"\r\n class=\"backgroundDisable\"\r\n ></div>\r\n\r\n <div *ngIf=\"!auth.logged && showLoginDiv\" class=\"login center-block\">\r\n <h1>{{ 'igo.auth.connection' | translate }}</h1>\r\n\r\n <igo-auth-google\r\n *ngIf=\"options.google && options.google.enabled !== false\"\r\n (login)=\"onLogin()\"\r\n >\r\n </igo-auth-google>\r\n <igo-auth-microsoft\r\n *ngIf=\"options.microsoft && options.microsoft.enabled !== false\"\r\n (login)=\"onLogin()\"\r\n >\r\n </igo-auth-microsoft>\r\n <igo-auth-microsoftb2c\r\n *ngIf=\"options.microsoftb2c && options.microsoftb2c.enabled !== false\"\r\n (login)=\"onLogin()\"\r\n >\r\n </igo-auth-microsoftb2c>\r\n <igo-auth-facebook\r\n *ngIf=\"options.facebook && options.facebook.enabled !== false\"\r\n (login)=\"onLogin()\"\r\n >\r\n </igo-auth-facebook>\r\n <igo-auth-intern\r\n *ngIf=\"!options.intern || options.intern.enabled !== false\"\r\n [allowAnonymous]=\"options.allowAnonymous\"\r\n (login)=\"onLogin()\"\r\n >\r\n </igo-auth-intern>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"auth.logged && showAlreadyConnectedDiv\"\r\n class=\"login center-block\"\r\n >\r\n <p>{{ 'igo.auth.welcome' | translate: user }}</p>\r\n <button mat-raised-button type=\"button\" (click)=\"logout()\">\r\n {{ 'igo.auth.signOut' | translate }}\r\n </button>\r\n </div>\r\n\r\n <div *ngIf=\"showLogoutDiv\" class=\"login center-block\">\r\n <p>{{ 'igo.auth.deconnection' | translate }}</p>\r\n <button\r\n *ngIf=\"options.homeRoute\"\r\n mat-raised-button\r\n type=\"button\"\r\n (click)=\"home()\"\r\n >\r\n {{ 'igo.auth.home' | translate }}\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [":host{z-index:999}div.login{z-index:200;width:90%;min-width:360px;max-width:600px;padding:25px 50px;border:1px solid;background-color:#fff;border-color:#888}.center-block{position:fixed;top:20%;left:50%;transform:translate(-50%)}.backgroundDisable{position:fixed;top:0;left:0;background:#000;opacity:.8;z-index:100;height:100%;width:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: AuthGoogleComponent, selector: "igo-auth-google", outputs: ["login"] }, { kind: "component", type: AuthInternComponent, selector: "igo-auth-intern", inputs: ["allowAnonymous"], outputs: ["login"] }, { kind: "component", type: AuthFacebookComponent, selector: "igo-auth-facebook", outputs: ["login"] }, { kind: "component", type: AuthMicrosoftComponent, selector: "igo-auth-microsoft", outputs: ["login"] }, { kind: "component", type: AuthMicrosoftb2cComponent, selector: "igo-auth-microsoftb2c", outputs: ["login"] }, { kind: "pipe", type: i6$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
1062
851
|
}
|
|
1063
|
-
(
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthFormComponent, decorators: [{
|
|
853
|
+
type: Component,
|
|
854
|
+
args: [{ selector: 'igo-auth-form', changeDetection: ChangeDetectionStrategy.Default, template: "<div *ngIf=\"visible\">\r\n <div\r\n *ngIf=\"!auth.logged && backgroundDisable\"\r\n class=\"backgroundDisable\"\r\n ></div>\r\n\r\n <div *ngIf=\"!auth.logged && showLoginDiv\" class=\"login center-block\">\r\n <h1>{{ 'igo.auth.connection' | translate }}</h1>\r\n\r\n <igo-auth-google\r\n *ngIf=\"options.google && options.google.enabled !== false\"\r\n (login)=\"onLogin()\"\r\n >\r\n </igo-auth-google>\r\n <igo-auth-microsoft\r\n *ngIf=\"options.microsoft && options.microsoft.enabled !== false\"\r\n (login)=\"onLogin()\"\r\n >\r\n </igo-auth-microsoft>\r\n <igo-auth-microsoftb2c\r\n *ngIf=\"options.microsoftb2c && options.microsoftb2c.enabled !== false\"\r\n (login)=\"onLogin()\"\r\n >\r\n </igo-auth-microsoftb2c>\r\n <igo-auth-facebook\r\n *ngIf=\"options.facebook && options.facebook.enabled !== false\"\r\n (login)=\"onLogin()\"\r\n >\r\n </igo-auth-facebook>\r\n <igo-auth-intern\r\n *ngIf=\"!options.intern || options.intern.enabled !== false\"\r\n [allowAnonymous]=\"options.allowAnonymous\"\r\n (login)=\"onLogin()\"\r\n >\r\n </igo-auth-intern>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"auth.logged && showAlreadyConnectedDiv\"\r\n class=\"login center-block\"\r\n >\r\n <p>{{ 'igo.auth.welcome' | translate: user }}</p>\r\n <button mat-raised-button type=\"button\" (click)=\"logout()\">\r\n {{ 'igo.auth.signOut' | translate }}\r\n </button>\r\n </div>\r\n\r\n <div *ngIf=\"showLogoutDiv\" class=\"login center-block\">\r\n <p>{{ 'igo.auth.deconnection' | translate }}</p>\r\n <button\r\n *ngIf=\"options.homeRoute\"\r\n mat-raised-button\r\n type=\"button\"\r\n (click)=\"home()\"\r\n >\r\n {{ 'igo.auth.home' | translate }}\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [":host{z-index:999}div.login{z-index:200;width:90%;min-width:360px;max-width:600px;padding:25px 50px;border:1px solid;background-color:#fff;border-color:#888}.center-block{position:fixed;top:20%;left:50%;transform:translate(-50%)}.backgroundDisable{position:fixed;top:0;left:0;background:#000;opacity:.8;z-index:100;height:100%;width:100%}\n"] }]
|
|
855
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i3.Router, decorators: [{
|
|
856
|
+
type: Optional
|
|
857
|
+
}] }]; }, propDecorators: { backgroundDisable: [{
|
|
858
|
+
type: Input
|
|
859
|
+
}], hasAlreadyConnectedDiv: [{
|
|
860
|
+
type: Input
|
|
861
|
+
}], hasLogoutDiv: [{
|
|
862
|
+
type: Input
|
|
863
|
+
}], showAlreadyConnectedDiv: [{
|
|
864
|
+
type: Input
|
|
865
|
+
}], showLogoutDiv: [{
|
|
866
|
+
type: Input
|
|
867
|
+
}], login: [{
|
|
868
|
+
type: Output
|
|
869
|
+
}] } });
|
|
1081
870
|
|
|
1082
871
|
class LoggedGuard {
|
|
1083
872
|
authService;
|
|
@@ -1099,15 +888,15 @@ class LoggedGuard {
|
|
|
1099
888
|
}
|
|
1100
889
|
return false;
|
|
1101
890
|
}
|
|
1102
|
-
static ɵfac =
|
|
1103
|
-
static ɵprov =
|
|
891
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoggedGuard, deps: [{ token: AuthService }, { token: i2.ConfigService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
892
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoggedGuard, providedIn: 'root' });
|
|
1104
893
|
}
|
|
1105
|
-
(
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
894
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoggedGuard, decorators: [{
|
|
895
|
+
type: Injectable,
|
|
896
|
+
args: [{
|
|
897
|
+
providedIn: 'root'
|
|
898
|
+
}]
|
|
899
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i3.Router }]; } });
|
|
1111
900
|
|
|
1112
901
|
class AuthGuard {
|
|
1113
902
|
authService;
|
|
@@ -1129,15 +918,15 @@ class AuthGuard {
|
|
|
1129
918
|
}
|
|
1130
919
|
return false;
|
|
1131
920
|
}
|
|
1132
|
-
static ɵfac =
|
|
1133
|
-
static ɵprov =
|
|
921
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthGuard, deps: [{ token: AuthService }, { token: i2.ConfigService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
922
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthGuard, providedIn: 'root' });
|
|
1134
923
|
}
|
|
1135
|
-
(
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
924
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthGuard, decorators: [{
|
|
925
|
+
type: Injectable,
|
|
926
|
+
args: [{
|
|
927
|
+
providedIn: 'root'
|
|
928
|
+
}]
|
|
929
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i3.Router }]; } });
|
|
1141
930
|
|
|
1142
931
|
class AdminGuard {
|
|
1143
932
|
authService;
|
|
@@ -1149,8 +938,7 @@ class AdminGuard {
|
|
|
1149
938
|
this.router = router;
|
|
1150
939
|
}
|
|
1151
940
|
canActivate(route, state) {
|
|
1152
|
-
|
|
1153
|
-
if (token && token.user && token.user.isAdmin) {
|
|
941
|
+
if (this.authService.isAdmin) {
|
|
1154
942
|
return true;
|
|
1155
943
|
}
|
|
1156
944
|
this.authService.redirectUrl = state.url;
|
|
@@ -1160,15 +948,15 @@ class AdminGuard {
|
|
|
1160
948
|
}
|
|
1161
949
|
return false;
|
|
1162
950
|
}
|
|
1163
|
-
static ɵfac =
|
|
1164
|
-
static ɵprov =
|
|
951
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AdminGuard, deps: [{ token: AuthService }, { token: i2.ConfigService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
952
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AdminGuard, providedIn: 'root' });
|
|
1165
953
|
}
|
|
1166
|
-
(
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
954
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AdminGuard, decorators: [{
|
|
955
|
+
type: Injectable,
|
|
956
|
+
args: [{
|
|
957
|
+
providedIn: 'root'
|
|
958
|
+
}]
|
|
959
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i3.Router }]; } });
|
|
1172
960
|
|
|
1173
961
|
class ProfilsGuard {
|
|
1174
962
|
authService;
|
|
@@ -1194,15 +982,15 @@ class ProfilsGuard {
|
|
|
1194
982
|
return false;
|
|
1195
983
|
}));
|
|
1196
984
|
}
|
|
1197
|
-
static ɵfac =
|
|
1198
|
-
static ɵprov =
|
|
985
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ProfilsGuard, deps: [{ token: AuthService }, { token: i2.ConfigService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
986
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ProfilsGuard, providedIn: 'root' });
|
|
1199
987
|
}
|
|
1200
|
-
(
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
988
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ProfilsGuard, decorators: [{
|
|
989
|
+
type: Injectable,
|
|
990
|
+
args: [{
|
|
991
|
+
providedIn: 'root'
|
|
992
|
+
}]
|
|
993
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i3.Router }]; } });
|
|
1206
994
|
|
|
1207
995
|
class AuthInterceptor {
|
|
1208
996
|
config;
|
|
@@ -1253,10 +1041,7 @@ class AuthInterceptor {
|
|
|
1253
1041
|
headers: req.headers.set('Authorization', authHeader)
|
|
1254
1042
|
});
|
|
1255
1043
|
const tokenDecoded = this.tokenService.decode();
|
|
1256
|
-
if (authReq.params.get('_i') === 'true' &&
|
|
1257
|
-
tokenDecoded &&
|
|
1258
|
-
tokenDecoded.user &&
|
|
1259
|
-
tokenDecoded.user.sourceId) {
|
|
1044
|
+
if (authReq.params.get('_i') === 'true' && tokenDecoded?.user?.sourceId) {
|
|
1260
1045
|
const hashUser = Md5.hashStr(tokenDecoded.user.sourceId);
|
|
1261
1046
|
authReq = authReq.clone({
|
|
1262
1047
|
params: authReq.params.set('_i', hashUser)
|
|
@@ -1350,15 +1135,15 @@ class AuthInterceptor {
|
|
|
1350
1135
|
});
|
|
1351
1136
|
}
|
|
1352
1137
|
}
|
|
1353
|
-
static ɵfac =
|
|
1354
|
-
static ɵprov =
|
|
1138
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthInterceptor, deps: [{ token: i2.ConfigService }, { token: TokenService }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1139
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthInterceptor, providedIn: 'root' });
|
|
1355
1140
|
}
|
|
1356
|
-
(
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthInterceptor, decorators: [{
|
|
1142
|
+
type: Injectable,
|
|
1143
|
+
args: [{
|
|
1144
|
+
providedIn: 'root'
|
|
1145
|
+
}]
|
|
1146
|
+
}], ctorParameters: function () { return [{ type: i2.ConfigService }, { type: TokenService }, { type: i1.HttpClient }]; } });
|
|
1362
1147
|
|
|
1363
1148
|
function MSALConfigFactory(config) {
|
|
1364
1149
|
const msConf = config.getConfig('auth.microsoft');
|
|
@@ -1448,15 +1233,15 @@ class ProtectedDirective {
|
|
|
1448
1233
|
el.nativeElement.parentNode.removeChild(el.nativeElement);
|
|
1449
1234
|
}
|
|
1450
1235
|
}
|
|
1451
|
-
static ɵfac =
|
|
1452
|
-
static ɵdir =
|
|
1236
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ProtectedDirective, deps: [{ token: AuthService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1237
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ProtectedDirective, selector: "[igoProtected]", ngImport: i0 });
|
|
1453
1238
|
}
|
|
1454
|
-
(
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ProtectedDirective, decorators: [{
|
|
1240
|
+
type: Directive,
|
|
1241
|
+
args: [{
|
|
1242
|
+
selector: '[igoProtected]'
|
|
1243
|
+
}]
|
|
1244
|
+
}], ctorParameters: function () { return [{ type: AuthService }, { type: i0.ElementRef }]; } });
|
|
1460
1245
|
|
|
1461
1246
|
class AuthStorageService extends BaseStorage {
|
|
1462
1247
|
http;
|
|
@@ -1537,34 +1322,100 @@ class AuthStorageService extends BaseStorage {
|
|
|
1537
1322
|
});
|
|
1538
1323
|
}
|
|
1539
1324
|
}
|
|
1540
|
-
static ɵfac =
|
|
1541
|
-
static ɵprov =
|
|
1325
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthStorageService, deps: [{ token: i2.ConfigService }, { token: i1.HttpClient }, { token: AuthService }, { token: TokenService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1326
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthStorageService, providedIn: 'root' });
|
|
1327
|
+
}
|
|
1328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthStorageService, decorators: [{
|
|
1329
|
+
type: Injectable,
|
|
1330
|
+
args: [{
|
|
1331
|
+
providedIn: 'root'
|
|
1332
|
+
}]
|
|
1333
|
+
}], ctorParameters: function () { return [{ type: i2.ConfigService }, { type: i1.HttpClient }, { type: AuthService }, { type: TokenService }]; } });
|
|
1334
|
+
|
|
1335
|
+
class AuthMonitoringService {
|
|
1336
|
+
configService;
|
|
1337
|
+
monitoringOptions;
|
|
1338
|
+
injector;
|
|
1339
|
+
// The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER
|
|
1340
|
+
authService;
|
|
1341
|
+
constructor(configService, monitoringOptions, injector) {
|
|
1342
|
+
this.configService = configService;
|
|
1343
|
+
this.monitoringOptions = monitoringOptions;
|
|
1344
|
+
this.injector = injector;
|
|
1345
|
+
if (!this.monitoringOptions?.identifyUser) {
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
this.configService.isLoaded$
|
|
1349
|
+
.pipe(first((isLoaded) => isLoaded), switchMap(() => {
|
|
1350
|
+
this.authService = this.injector.get(AuthService);
|
|
1351
|
+
return this.authService?.authenticate$;
|
|
1352
|
+
}))
|
|
1353
|
+
.subscribe((isAuthenticated) => {
|
|
1354
|
+
const user = isAuthenticated ? this.authService.user : null;
|
|
1355
|
+
this._identifyUser(user);
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
_identifyUser(user) {
|
|
1359
|
+
switch (this.monitoringOptions.provider) {
|
|
1360
|
+
case 'sentry':
|
|
1361
|
+
identifySentryUser(user);
|
|
1362
|
+
break;
|
|
1363
|
+
default:
|
|
1364
|
+
break;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthMonitoringService, deps: [{ token: i2.ConfigService }, { token: MONITORING_OPTIONS, optional: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1368
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
|
|
1369
|
+
}
|
|
1370
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthMonitoringService, decorators: [{
|
|
1371
|
+
type: Injectable,
|
|
1372
|
+
args: [{
|
|
1373
|
+
providedIn: 'root'
|
|
1374
|
+
}]
|
|
1375
|
+
}], ctorParameters: function () { return [{ type: i2.ConfigService }, { type: undefined, decorators: [{
|
|
1376
|
+
type: Optional
|
|
1377
|
+
}, {
|
|
1378
|
+
type: Inject,
|
|
1379
|
+
args: [MONITORING_OPTIONS]
|
|
1380
|
+
}] }, { type: i0.Injector }]; } });
|
|
1381
|
+
|
|
1382
|
+
function provideAuthUserMonitoring(options) {
|
|
1383
|
+
if (!options) {
|
|
1384
|
+
return [];
|
|
1385
|
+
}
|
|
1386
|
+
return [
|
|
1387
|
+
{
|
|
1388
|
+
provide: AuthMonitoringService,
|
|
1389
|
+
useClass: AuthMonitoringService,
|
|
1390
|
+
deps: [ConfigService, MONITORING_OPTIONS, Injector]
|
|
1391
|
+
},
|
|
1392
|
+
// Force instantiate Tracing service to avoid require it in any constructor.
|
|
1393
|
+
{
|
|
1394
|
+
provide: APP_INITIALIZER,
|
|
1395
|
+
useFactory: () => () => { },
|
|
1396
|
+
deps: [AuthMonitoringService],
|
|
1397
|
+
multi: true
|
|
1398
|
+
}
|
|
1399
|
+
];
|
|
1542
1400
|
}
|
|
1543
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthStorageService, [{
|
|
1544
|
-
type: Injectable,
|
|
1545
|
-
args: [{
|
|
1546
|
-
providedIn: 'root'
|
|
1547
|
-
}]
|
|
1548
|
-
}], function () { return [{ type: i2.ConfigService }, { type: i1.HttpClient }, { type: AuthService }, { type: TokenService }]; }, null); })();
|
|
1549
1401
|
|
|
1550
1402
|
const routes = [
|
|
1551
1403
|
{ path: 'login', component: AuthFormComponent },
|
|
1552
1404
|
{ path: 'logout', component: AuthFormComponent }
|
|
1553
1405
|
];
|
|
1554
1406
|
class AuthRoutingModule {
|
|
1555
|
-
static ɵfac =
|
|
1556
|
-
static ɵmod =
|
|
1557
|
-
static ɵinj =
|
|
1407
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1408
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: AuthRoutingModule, imports: [i3.RouterModule], exports: [RouterModule] });
|
|
1409
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
|
|
1558
1410
|
}
|
|
1559
|
-
(
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AuthRoutingModule, { imports: [i3.RouterModule], exports: [RouterModule] }); })();
|
|
1411
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthRoutingModule, decorators: [{
|
|
1412
|
+
type: NgModule,
|
|
1413
|
+
args: [{
|
|
1414
|
+
imports: [RouterModule.forChild(routes)],
|
|
1415
|
+
exports: [RouterModule],
|
|
1416
|
+
providers: []
|
|
1417
|
+
}]
|
|
1418
|
+
}] });
|
|
1568
1419
|
|
|
1569
1420
|
class IgoAuthModule {
|
|
1570
1421
|
static forRoot() {
|
|
@@ -1585,9 +1436,22 @@ class IgoAuthModule {
|
|
|
1585
1436
|
]
|
|
1586
1437
|
};
|
|
1587
1438
|
}
|
|
1588
|
-
static ɵfac =
|
|
1589
|
-
static ɵmod =
|
|
1590
|
-
|
|
1439
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: IgoAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1440
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: IgoAuthModule, declarations: [AuthFormComponent,
|
|
1441
|
+
AuthGoogleComponent,
|
|
1442
|
+
AuthInternComponent,
|
|
1443
|
+
AuthFacebookComponent,
|
|
1444
|
+
AuthMicrosoftComponent,
|
|
1445
|
+
AuthMicrosoftb2cComponent,
|
|
1446
|
+
ProtectedDirective], imports: [CommonModule,
|
|
1447
|
+
ReactiveFormsModule,
|
|
1448
|
+
MatFormFieldModule,
|
|
1449
|
+
MatInputModule,
|
|
1450
|
+
MatIconModule,
|
|
1451
|
+
MatButtonModule,
|
|
1452
|
+
IgoLanguageModule,
|
|
1453
|
+
MsalModule], exports: [AuthFormComponent, ProtectedDirective] });
|
|
1454
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: IgoAuthModule, imports: [CommonModule,
|
|
1591
1455
|
ReactiveFormsModule,
|
|
1592
1456
|
MatFormFieldModule,
|
|
1593
1457
|
MatInputModule,
|
|
@@ -1596,45 +1460,31 @@ class IgoAuthModule {
|
|
|
1596
1460
|
IgoLanguageModule,
|
|
1597
1461
|
MsalModule] });
|
|
1598
1462
|
}
|
|
1599
|
-
(
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoAuthModule, { declarations: [AuthFormComponent,
|
|
1625
|
-
AuthGoogleComponent,
|
|
1626
|
-
AuthInternComponent,
|
|
1627
|
-
AuthFacebookComponent,
|
|
1628
|
-
AuthMicrosoftComponent,
|
|
1629
|
-
AuthMicrosoftb2cComponent,
|
|
1630
|
-
ProtectedDirective], imports: [CommonModule,
|
|
1631
|
-
ReactiveFormsModule,
|
|
1632
|
-
MatFormFieldModule,
|
|
1633
|
-
MatInputModule,
|
|
1634
|
-
MatIconModule,
|
|
1635
|
-
MatButtonModule,
|
|
1636
|
-
IgoLanguageModule,
|
|
1637
|
-
MsalModule], exports: [AuthFormComponent, ProtectedDirective] }); })();
|
|
1463
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: IgoAuthModule, decorators: [{
|
|
1464
|
+
type: NgModule,
|
|
1465
|
+
args: [{
|
|
1466
|
+
imports: [
|
|
1467
|
+
CommonModule,
|
|
1468
|
+
ReactiveFormsModule,
|
|
1469
|
+
MatFormFieldModule,
|
|
1470
|
+
MatInputModule,
|
|
1471
|
+
MatIconModule,
|
|
1472
|
+
MatButtonModule,
|
|
1473
|
+
IgoLanguageModule,
|
|
1474
|
+
MsalModule
|
|
1475
|
+
],
|
|
1476
|
+
declarations: [
|
|
1477
|
+
AuthFormComponent,
|
|
1478
|
+
AuthGoogleComponent,
|
|
1479
|
+
AuthInternComponent,
|
|
1480
|
+
AuthFacebookComponent,
|
|
1481
|
+
AuthMicrosoftComponent,
|
|
1482
|
+
AuthMicrosoftb2cComponent,
|
|
1483
|
+
ProtectedDirective
|
|
1484
|
+
],
|
|
1485
|
+
exports: [AuthFormComponent, ProtectedDirective]
|
|
1486
|
+
}]
|
|
1487
|
+
}] });
|
|
1638
1488
|
|
|
1639
1489
|
/*
|
|
1640
1490
|
* Public API Surface of auth
|
|
@@ -1644,5 +1494,5 @@ class IgoAuthModule {
|
|
|
1644
1494
|
* Generated bundle index. Do not edit.
|
|
1645
1495
|
*/
|
|
1646
1496
|
|
|
1647
|
-
export { AdminGuard, AuthFormComponent, AuthGuard, AuthInterceptor, AuthRoutingModule, AuthService, AuthStorageService, IgoAuthModule, LoggedGuard, MSALAngularConfigFactory, MSALAngularConfigFactoryb2c, MSALConfigFactory, MSALConfigFactoryb2c, ProfilsGuard, ProtectedDirective, TokenService, provideAuthMicrosoft };
|
|
1497
|
+
export { AdminGuard, AuthFormComponent, AuthGuard, AuthInterceptor, AuthMonitoringService, AuthRoutingModule, AuthService, AuthStorageService, IgoAuthModule, LoggedGuard, MSALAngularConfigFactory, MSALAngularConfigFactoryb2c, MSALConfigFactory, MSALConfigFactoryb2c, ProfilsGuard, ProtectedDirective, TokenService, provideAuthMicrosoft, provideAuthUserMonitoring };
|
|
1648
1498
|
//# sourceMappingURL=igo2-auth.mjs.map
|