@igo2/auth 1.12.0 → 1.13.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/{esm2015/igo2-auth.js → esm2020/igo2-auth.mjs} +0 -0
  2. package/{esm2015/lib/auth-form/auth-facebook.component.js → esm2020/lib/auth-form/auth-facebook.component.mjs} +2 -7
  3. package/esm2020/lib/auth-form/auth-form.component.mjs +277 -0
  4. package/{esm2015/lib/auth-form/auth-google.component.js → esm2020/lib/auth-form/auth-google.component.mjs} +2 -7
  5. package/esm2020/lib/auth-form/auth-intern.component.mjs +119 -0
  6. package/esm2020/lib/auth-form/auth-microsoft.component.mjs +94 -0
  7. package/esm2020/lib/auth-form/auth-microsoftb2c.component.mjs +93 -0
  8. package/{esm2015/lib/auth-form/index.js → esm2020/lib/auth-form/index.mjs} +0 -0
  9. package/{esm2015/lib/auth-routing.module.js → esm2020/lib/auth-routing.module.mjs} +2 -2
  10. package/{esm2015/lib/auth.module.js → esm2020/lib/auth.module.mjs} +9 -11
  11. package/{esm2015/lib/shared/admin.guard.js → esm2020/lib/shared/admin.guard.mjs} +0 -0
  12. package/{esm2015/lib/shared/auth-microsoft.provider.js → esm2020/lib/shared/auth-microsoft.provider.mjs} +0 -0
  13. package/{esm2015/lib/shared/auth-msalBroadcastServiceb2c.service.js → esm2020/lib/shared/auth-msalBroadcastServiceb2c.service.mjs} +0 -0
  14. package/esm2020/lib/shared/auth-msalServiceb2c.service..mjs +80 -0
  15. package/{esm2015/lib/shared/auth.guard.js → esm2020/lib/shared/auth.guard.mjs} +0 -0
  16. package/{esm2015/lib/shared/auth.interceptor.js → esm2020/lib/shared/auth.interceptor.mjs} +0 -0
  17. package/{esm2015/lib/shared/auth.interface.js → esm2020/lib/shared/auth.interface.mjs} +0 -0
  18. package/{esm2015/lib/shared/auth.service.js → esm2020/lib/shared/auth.service.mjs} +0 -0
  19. package/{esm2015/lib/shared/logged.guard.js → esm2020/lib/shared/logged.guard.mjs} +0 -0
  20. package/{esm2015/lib/shared/profils.guard.js → esm2020/lib/shared/profils.guard.mjs} +0 -0
  21. package/{esm2015/lib/shared/protected.directive.js → esm2020/lib/shared/protected.directive.mjs} +0 -0
  22. package/{esm2015/lib/shared/storage.interface.js → esm2020/lib/shared/storage.interface.mjs} +0 -0
  23. package/{esm2015/lib/shared/storage.service.js → esm2020/lib/shared/storage.service.mjs} +0 -0
  24. package/{esm2015/lib/shared/token.service.js → esm2020/lib/shared/token.service.mjs} +0 -0
  25. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  26. package/fesm2015/igo2-auth.mjs +1655 -0
  27. package/fesm2015/igo2-auth.mjs.map +1 -0
  28. package/{fesm2015/igo2-auth.js → fesm2020/igo2-auth.mjs} +215 -254
  29. package/fesm2020/igo2-auth.mjs.map +1 -0
  30. package/{igo2-auth.d.ts → index.d.ts} +0 -0
  31. package/lib/auth-form/auth-facebook.component.d.ts +1 -1
  32. package/lib/auth-form/auth-form.component.d.ts +1 -1
  33. package/lib/auth-form/auth-google.component.d.ts +1 -1
  34. package/lib/auth-form/auth-intern.component.d.ts +1 -1
  35. package/lib/auth-form/auth-microsoft.component.d.ts +1 -1
  36. package/lib/auth-form/auth-microsoftb2c.component.d.ts +1 -1
  37. package/lib/shared/auth-msalServiceb2c.service..d.ts +1 -0
  38. package/lib/shared/protected.directive.d.ts +1 -1
  39. package/package.json +27 -14
  40. package/bundles/igo2-auth.umd.js +0 -2203
  41. package/bundles/igo2-auth.umd.js.map +0 -1
  42. package/esm2015/lib/auth-form/auth-form.component.js +0 -286
  43. package/esm2015/lib/auth-form/auth-intern.component.js +0 -129
  44. package/esm2015/lib/auth-form/auth-microsoft.component.js +0 -100
  45. package/esm2015/lib/auth-form/auth-microsoftb2c.component.js +0 -99
  46. package/esm2015/lib/shared/auth-msalServiceb2c.service..js +0 -77
  47. package/fesm2015/igo2-auth.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Optional, EventEmitter, Component, ChangeDetectionStrategy, Output, Inject, Input, Directive, NgModule } from '@angular/core';
2
+ import { Injectable, Optional, EventEmitter, Component, ChangeDetectionStrategy, Output, Input, Inject, Directive, NgModule } from '@angular/core';
3
3
  import * as i3 from '@angular/router';
4
4
  import { NavigationStart, RouterModule } from '@angular/router';
5
5
  import { tap, catchError, filter, takeUntil, map } from 'rxjs/operators';
@@ -13,21 +13,20 @@ import * as i2 from '@igo2/core';
13
13
  import { ConfigService, StorageService, StorageScope, IgoLanguageModule } from '@igo2/core';
14
14
  import * as i1$1 from '@angular/common';
15
15
  import { CommonModule } from '@angular/common';
16
- import { __awaiter } from 'tslib';
17
- import * as i3$1 from '@azure/msal-angular';
18
- import { MsalBroadcastService, MSAL_GUARD_CONFIG, MSAL_INSTANCE, MsalService, MsalModule } from '@azure/msal-angular';
19
- import { PublicClientApplication, InteractionStatus, InteractionRequiredAuthError, WrapperSKU, EventMessageUtils, InteractionType } from '@azure/msal-browser';
20
- import * as i4 from '@angular/material/button';
16
+ import * as i5$1 from '@angular/material/button';
21
17
  import { MatButtonModule } from '@angular/material/button';
22
- import * as i5 from '@angular/material/icon';
23
- import { MatIconModule } from '@angular/material/icon';
24
- import * as i6 from '@ngx-translate/core';
25
- import * as i3$2 from '@angular/forms';
18
+ import * as i3$1 from '@angular/forms';
26
19
  import { Validators, ReactiveFormsModule } from '@angular/forms';
27
- import * as i4$1 from '@angular/material/form-field';
20
+ import * as i5 from '@angular/material/form-field';
28
21
  import { MatFormFieldModule } from '@angular/material/form-field';
29
- import * as i5$1 from '@angular/material/input';
22
+ import * as i6 from '@angular/material/input';
30
23
  import { MatInputModule } from '@angular/material/input';
24
+ import * as i6$1 from '@ngx-translate/core';
25
+ import * as i3$2 from '@azure/msal-angular';
26
+ import { MsalBroadcastService, MSAL_GUARD_CONFIG, MSAL_INSTANCE, MsalService, MsalModule } from '@azure/msal-angular';
27
+ import { PublicClientApplication, InteractionStatus, InteractionRequiredAuthError, WrapperSKU, EventMessageUtils, InteractionType } from '@azure/msal-browser';
28
+ import * as i4 from '@angular/material/icon';
29
+ import { MatIconModule } from '@angular/material/icon';
31
30
  import { Md5 } from 'ts-md5';
32
31
 
33
32
  class TokenService {
@@ -311,16 +310,176 @@ AuthGoogleComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AuthGoo
311
310
  } }, styles: ["[_nghost-%COMP%]{padding:10px 10px 10px 0;display:inline-block}.google-login-button[_ngcontent-%COMP%] .abcRioButton{color:#000000de}"], changeDetection: 0 });
312
311
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthGoogleComponent, [{
313
312
  type: Component,
314
- args: [{
315
- selector: 'igo-auth-google',
316
- templateUrl: './auth-google.component.html',
317
- styleUrls: ['./auth-google.component.scss'],
318
- changeDetection: ChangeDetectionStrategy.OnPush
319
- }]
313
+ args: [{ selector: 'igo-auth-google', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"g-signin2 google-login-button\" data-height=\"40\" data-width=\"265\" data-longtitle=\"true\">\r\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block}.google-login-button ::ng-deep .abcRioButton{color:#000000de}\n"] }]
320
314
  }], function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i2.LanguageService }, { type: i0.ApplicationRef }]; }, { login: [{
321
315
  type: Output
322
316
  }] }); })();
323
317
 
318
+ function AuthInternComponent_button_12_Template(rf, ctx) { if (rf & 1) {
319
+ const _r3 = i0.ɵɵgetCurrentView();
320
+ i0.ɵɵelementStart(0, "button", 7);
321
+ i0.ɵɵlistener("click", function AuthInternComponent_button_12_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.loginAnonymous()); });
322
+ i0.ɵɵtext(1);
323
+ i0.ɵɵpipe(2, "translate");
324
+ i0.ɵɵelementEnd();
325
+ } if (rf & 2) {
326
+ const ctx_r0 = i0.ɵɵnextContext();
327
+ i0.ɵɵproperty("disabled", ctx_r0.loading);
328
+ i0.ɵɵadvance(1);
329
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2, "igo.auth.accessAnonymous"), " ");
330
+ } }
331
+ function AuthInternComponent_div_13_Template(rf, ctx) { if (rf & 1) {
332
+ i0.ɵɵelementStart(0, "div");
333
+ i0.ɵɵelement(1, "br");
334
+ i0.ɵɵelementStart(2, "font", 8);
335
+ i0.ɵɵtext(3);
336
+ i0.ɵɵelementEnd()();
337
+ } if (rf & 2) {
338
+ const ctx_r1 = i0.ɵɵnextContext();
339
+ i0.ɵɵadvance(3);
340
+ i0.ɵɵtextInterpolate(ctx_r1.error);
341
+ } }
342
+ class AuthInternComponent {
343
+ constructor(auth, languageService, fb) {
344
+ this.auth = auth;
345
+ this.languageService = languageService;
346
+ this._allowAnonymous = true;
347
+ this.error = '';
348
+ this.loading = false;
349
+ this.login = new EventEmitter();
350
+ this.form = fb.group({
351
+ username: ['', Validators.required],
352
+ password: ['', Validators.required]
353
+ });
354
+ }
355
+ get allowAnonymous() {
356
+ return this._allowAnonymous;
357
+ }
358
+ set allowAnonymous(value) {
359
+ this._allowAnonymous = value;
360
+ }
361
+ loginUser(values) {
362
+ this.loading = true;
363
+ this.auth.login(values.username, values.password).subscribe(() => {
364
+ this.login.emit(true);
365
+ this.loading = false;
366
+ }, (error) => {
367
+ try {
368
+ this.languageService.translate
369
+ .get('igo.auth.error.' + error.error.message)
370
+ .subscribe(errorMsg => (this.error = errorMsg));
371
+ }
372
+ catch (e) {
373
+ this.error = error.error.message;
374
+ }
375
+ this.loading = false;
376
+ });
377
+ return false;
378
+ }
379
+ loginAnonymous() {
380
+ this.auth.loginAnonymous().subscribe(() => {
381
+ this.login.emit(true);
382
+ });
383
+ }
384
+ }
385
+ AuthInternComponent.ɵfac = function AuthInternComponent_Factory(t) { return new (t || AuthInternComponent)(i0.ɵɵdirectiveInject(AuthService), i0.ɵɵdirectiveInject(i2.LanguageService), i0.ɵɵdirectiveInject(i3$1.FormBuilder)); };
386
+ AuthInternComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AuthInternComponent, selectors: [["igo-auth-intern"]], inputs: { allowAnonymous: "allowAnonymous" }, outputs: { login: "login" }, decls: 14, vars: 12, consts: [["role", "form", 3, "formGroup", "ngSubmit"], [1, "full-width"], ["matInput", "", "required", "", "formControlName", "username", 3, "placeholder"], ["matInput", "", "required", "", "type", "password", "formControlName", "password", 3, "placeholder"], ["mat-raised-button", "", "type", "submit"], ["mat-raised-button", "", "class", "anonymous", "type", "button", 3, "disabled", "click", 4, "ngIf"], [4, "ngIf"], ["mat-raised-button", "", "type", "button", 1, "anonymous", 3, "disabled", "click"], ["size", "3", "color", "red"]], template: function AuthInternComponent_Template(rf, ctx) { if (rf & 1) {
387
+ i0.ɵɵelementStart(0, "form", 0);
388
+ i0.ɵɵlistener("ngSubmit", function AuthInternComponent_Template_form_ngSubmit_0_listener() { return ctx.loginUser(ctx.form.value); });
389
+ i0.ɵɵelementStart(1, "div")(2, "mat-form-field", 1);
390
+ i0.ɵɵelement(3, "input", 2);
391
+ i0.ɵɵpipe(4, "translate");
392
+ i0.ɵɵelementEnd()();
393
+ i0.ɵɵelementStart(5, "div")(6, "mat-form-field", 1);
394
+ i0.ɵɵelement(7, "input", 3);
395
+ i0.ɵɵpipe(8, "translate");
396
+ i0.ɵɵelementEnd()();
397
+ i0.ɵɵelementStart(9, "button", 4);
398
+ i0.ɵɵtext(10);
399
+ i0.ɵɵpipe(11, "translate");
400
+ i0.ɵɵelementEnd();
401
+ i0.ɵɵtemplate(12, AuthInternComponent_button_12_Template, 3, 4, "button", 5);
402
+ i0.ɵɵtemplate(13, AuthInternComponent_div_13_Template, 4, 1, "div", 6);
403
+ i0.ɵɵelementEnd();
404
+ } if (rf & 2) {
405
+ i0.ɵɵproperty("formGroup", ctx.form);
406
+ i0.ɵɵadvance(3);
407
+ i0.ɵɵpropertyInterpolate("placeholder", i0.ɵɵpipeBind1(4, 6, "igo.auth.user"));
408
+ i0.ɵɵadvance(4);
409
+ i0.ɵɵpropertyInterpolate("placeholder", i0.ɵɵpipeBind1(8, 8, "igo.auth.password"));
410
+ i0.ɵɵadvance(3);
411
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(11, 10, "igo.auth.login"));
412
+ i0.ɵɵadvance(2);
413
+ i0.ɵɵproperty("ngIf", ctx.allowAnonymous);
414
+ i0.ɵɵadvance(1);
415
+ i0.ɵɵproperty("ngIf", ctx.error);
416
+ } }, 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, i6.MatInput, i5$1.MatButton, i6$1.TranslatePipe], styles: [".full-width[_ngcontent-%COMP%]{width:100%}.anonymous[_ngcontent-%COMP%]{margin-left:10px}"] });
417
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthInternComponent, [{
418
+ type: Component,
419
+ 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 <input matInput required placeholder=\"{{'igo.auth.user' | translate}}\" formControlName=\"username\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field class=\"full-width\">\r\n <input matInput required type=\"password\" placeholder=\"{{'igo.auth.password' | translate}}\" formControlName=\"password\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <button mat-raised-button type=\"submit\">{{'igo.auth.login' | translate}}</button>\r\n <button *ngIf=\"allowAnonymous\" mat-raised-button class=\"anonymous\" type=\"button\" [disabled]=\"loading\" (click)=\"loginAnonymous()\">\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\r\n<!--\r\nThis part was removed from the below line to fix Angular issue 30616 : [disabled]=\"!form.valid || loading\r\n <button mat-raised-button type=\"submit\" [disabled]=\"!form.valid || loading\">{{'igo.auth.login' | translate}}</button>*/\r\n-->\r\n", styles: [".full-width{width:100%}.anonymous{margin-left:10px}\n"] }]
420
+ }], function () { return [{ type: AuthService }, { type: i2.LanguageService }, { type: i3$1.FormBuilder }]; }, { allowAnonymous: [{
421
+ type: Input
422
+ }], login: [{
423
+ type: Output
424
+ }] }); })();
425
+
426
+ class AuthFacebookComponent {
427
+ constructor(authService, config, appRef) {
428
+ this.authService = authService;
429
+ this.config = config;
430
+ this.appRef = appRef;
431
+ this.login = new EventEmitter();
432
+ this.options = this.config.getConfig('auth.facebook') || {};
433
+ if (this.options.appId) {
434
+ this.loadSDKFacebook();
435
+ }
436
+ else {
437
+ console.warn('Facebook authentification needs "appId" option');
438
+ }
439
+ }
440
+ subscribeEvents() {
441
+ window.FB.Event.subscribe('auth.statusChange', rep => {
442
+ this.statusChangeCallback(rep);
443
+ });
444
+ }
445
+ statusChangeCallback(response) {
446
+ if (response.status === 'connected') {
447
+ const accessToken = response.authResponse.accessToken;
448
+ this.loginFacebook(accessToken);
449
+ }
450
+ }
451
+ loginFacebook(token) {
452
+ this.authService.loginWithToken(token, 'facebook').subscribe(() => {
453
+ this.appRef.tick();
454
+ this.login.emit(true);
455
+ });
456
+ }
457
+ loadSDKFacebook() {
458
+ if (document.getElementById('facebook-jssdk')) {
459
+ return;
460
+ }
461
+ const urlSDK = 'https://connect.facebook.net/fr_CA/sdk.js#xfbml=1&version=v2.9';
462
+ const fjs = document.getElementsByTagName('script')[0];
463
+ const js = document.createElement('script');
464
+ js.id = 'facebook-jssdk';
465
+ js.src = `${urlSDK}&appId=${this.options.appId}`;
466
+ js.onload = () => {
467
+ this.subscribeEvents();
468
+ };
469
+ fjs.parentNode.insertBefore(js, fjs);
470
+ }
471
+ }
472
+ AuthFacebookComponent.ɵfac = function AuthFacebookComponent_Factory(t) { return new (t || AuthFacebookComponent)(i0.ɵɵdirectiveInject(AuthService), i0.ɵɵdirectiveInject(i2.ConfigService), i0.ɵɵdirectiveInject(i0.ApplicationRef)); };
473
+ AuthFacebookComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AuthFacebookComponent, selectors: [["igo-auth-facebook"]], outputs: { login: "login" }, decls: 1, vars: 0, consts: [["scope", "public_profile,email", "data-max-rows", "1", "data-size", "large", "data-button-type", "login_with", "data-show-faces", "false", "data-auto-logout-link", "false", "data-use-continue-as", "false", 1, "fb-login-button"]], template: function AuthFacebookComponent_Template(rf, ctx) { if (rf & 1) {
474
+ i0.ɵɵelement(0, "div", 0);
475
+ } }, styles: ["[_nghost-%COMP%]{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-3px}"], changeDetection: 0 });
476
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthFacebookComponent, [{
477
+ type: Component,
478
+ args: [{ selector: 'igo-auth-facebook', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div scope=\"public_profile,email\"\r\n class=\"fb-login-button\" data-max-rows=\"1\" data-size=\"large\"\r\n data-button-type=\"login_with\" data-show-faces=\"false\"\r\n data-auto-logout-link=\"false\" 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"] }]
479
+ }], function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }]; }, { login: [{
480
+ type: Output
481
+ }] }); })();
482
+
324
483
  class AuthMicrosoftComponent {
325
484
  constructor(authService, config, appRef, msalService, msalGuardConfig) {
326
485
  this.authService = authService;
@@ -350,7 +509,7 @@ class AuthMicrosoftComponent {
350
509
  }
351
510
  }
352
511
  loginMicrosoft() {
353
- this.msalService.loginPopup(Object.assign({}, this.getConf().authRequest))
512
+ this.msalService.loginPopup({ ...this.getConf().authRequest })
354
513
  .subscribe((response) => {
355
514
  this.msalService.instance.setActiveAccount(response.account);
356
515
  this.checkAccount();
@@ -367,13 +526,13 @@ class AuthMicrosoftComponent {
367
526
  this.login.emit(true);
368
527
  });
369
528
  })
370
- .catch((error) => __awaiter(this, void 0, void 0, function* () {
529
+ .catch(async (error) => {
371
530
  if (error instanceof InteractionRequiredAuthError) {
372
531
  // fallback to interaction when silent call fails
373
532
  return this.msalService.acquireTokenPopup(this.getConf().authRequest);
374
533
  }
375
534
  console.log(error);
376
- })).catch(error => {
535
+ }).catch(error => {
377
536
  console.log('Silent token fails');
378
537
  });
379
538
  }
@@ -381,7 +540,7 @@ class AuthMicrosoftComponent {
381
540
  return this.msalGuardConfig.filter(conf => conf.type === 'add')[0];
382
541
  }
383
542
  }
384
- AuthMicrosoftComponent.ɵfac = function AuthMicrosoftComponent_Factory(t) { return new (t || AuthMicrosoftComponent)(i0.ɵɵdirectiveInject(AuthService), i0.ɵɵdirectiveInject(i2.ConfigService), i0.ɵɵdirectiveInject(i0.ApplicationRef), i0.ɵɵdirectiveInject(i3$1.MsalService), i0.ɵɵdirectiveInject(MSAL_GUARD_CONFIG)); };
543
+ AuthMicrosoftComponent.ɵfac = function AuthMicrosoftComponent_Factory(t) { return new (t || AuthMicrosoftComponent)(i0.ɵɵdirectiveInject(AuthService), i0.ɵɵdirectiveInject(i2.ConfigService), i0.ɵɵdirectiveInject(i0.ApplicationRef), i0.ɵɵdirectiveInject(i3$2.MsalService), i0.ɵɵdirectiveInject(MSAL_GUARD_CONFIG)); };
385
544
  AuthMicrosoftComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AuthMicrosoftComponent, selectors: [["igo-auth-microsoft"]], outputs: { login: "login" }, decls: 4, vars: 3, consts: [["mat-raised-button", "", 1, "microsoft-login-button", 3, "click"], ["svgIcon", "microsoft"]], template: function AuthMicrosoftComponent_Template(rf, ctx) { if (rf & 1) {
386
545
  i0.ɵɵelementStart(0, "button", 0);
387
546
  i0.ɵɵlistener("click", function AuthMicrosoftComponent_Template_button_click_0_listener() { return ctx.loginMicrosoft(); });
@@ -392,16 +551,11 @@ AuthMicrosoftComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Auth
392
551
  } if (rf & 2) {
393
552
  i0.ɵɵadvance(2);
394
553
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 1, "igo.auth.microsoft.login"), "\n");
395
- } }, directives: [i4.MatButton, i5.MatIcon], pipes: [i6.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 });
554
+ } }, 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 });
396
555
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthMicrosoftComponent, [{
397
556
  type: Component,
398
- args: [{
399
- selector: 'igo-auth-microsoft',
400
- templateUrl: './auth-microsoft.component.html',
401
- styleUrls: ['./auth-microsoft.component.scss'],
402
- changeDetection: ChangeDetectionStrategy.OnPush
403
- }]
404
- }], function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }, { type: i3$1.MsalService }, { type: undefined, decorators: [{
557
+ args: [{ selector: 'igo-auth-microsoft', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button class=\"microsoft-login-button\" mat-raised-button (click)=\"loginMicrosoft()\">\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"] }]
558
+ }], function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }, { type: i3$2.MsalService }, { type: undefined, decorators: [{
405
559
  type: Inject,
406
560
  args: [MSAL_GUARD_CONFIG]
407
561
  }] }]; }, { login: [{
@@ -424,6 +578,9 @@ class MsalServiceb2c {
424
578
  }
425
579
  this.instance.initializeWrapperLibrary(WrapperSKU.Angular, this.version);
426
580
  }
581
+ initialize() {
582
+ return from(this.instance.initialize());
583
+ }
427
584
  acquireTokenPopup(request) {
428
585
  return from(this.instance.acquireTokenPopup(request));
429
586
  }
@@ -540,7 +697,7 @@ class AuthMicrosoftb2cComponent {
540
697
  }
541
698
  }
542
699
  loginMicrosoftb2c() {
543
- this.msalService.loginPopup(Object.assign({}, this.getConf().authRequest))
700
+ this.msalService.loginPopup({ ...this.getConf().authRequest })
544
701
  .subscribe((response) => {
545
702
  this.msalService.instance.setActiveAccount(response.account);
546
703
  this.checkAccount();
@@ -556,12 +713,12 @@ class AuthMicrosoftb2cComponent {
556
713
  this.login.emit(true);
557
714
  });
558
715
  })
559
- .catch((error) => __awaiter(this, void 0, void 0, function* () {
716
+ .catch(async (error) => {
560
717
  if (error instanceof InteractionRequiredAuthError) {
561
718
  // fallback to interaction when silent call fails
562
719
  return this.msalService.acquireTokenPopup(this.getConf().authRequest);
563
720
  }
564
- })).catch(error => {
721
+ }).catch(error => {
565
722
  console.log('Silent token fails');
566
723
  });
567
724
  }
@@ -580,15 +737,10 @@ AuthMicrosoftb2cComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: A
580
737
  } if (rf & 2) {
581
738
  i0.ɵɵadvance(2);
582
739
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 1, "igo.auth.microsoftb2c.login"), "\n");
583
- } }, directives: [i4.MatButton, i5.MatIcon], pipes: [i6.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 });
740
+ } }, 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 });
584
741
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthMicrosoftb2cComponent, [{
585
742
  type: Component,
586
- args: [{
587
- selector: 'igo-auth-microsoftb2c',
588
- templateUrl: './auth-microsoftb2c.component.html',
589
- styleUrls: ['./auth-microsoftb2c.component.scss'],
590
- changeDetection: ChangeDetectionStrategy.OnPush
591
- }]
743
+ args: [{ selector: 'igo-auth-microsoftb2c', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button class=\"microsoft-login-button\" mat-raised-button (click)=\"loginMicrosoftb2c()\">\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"] }]
592
744
  }], function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }, { type: MsalServiceb2c }, { type: undefined, decorators: [{
593
745
  type: Inject,
594
746
  args: [MSAL_GUARD_CONFIG]
@@ -596,225 +748,44 @@ AuthMicrosoftb2cComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: A
596
748
  type: Output
597
749
  }] }); })();
598
750
 
599
- class AuthFacebookComponent {
600
- constructor(authService, config, appRef) {
601
- this.authService = authService;
602
- this.config = config;
603
- this.appRef = appRef;
604
- this.login = new EventEmitter();
605
- this.options = this.config.getConfig('auth.facebook') || {};
606
- if (this.options.appId) {
607
- this.loadSDKFacebook();
608
- }
609
- else {
610
- console.warn('Facebook authentification needs "appId" option');
611
- }
612
- }
613
- subscribeEvents() {
614
- window.FB.Event.subscribe('auth.statusChange', rep => {
615
- this.statusChangeCallback(rep);
616
- });
617
- }
618
- statusChangeCallback(response) {
619
- if (response.status === 'connected') {
620
- const accessToken = response.authResponse.accessToken;
621
- this.loginFacebook(accessToken);
622
- }
623
- }
624
- loginFacebook(token) {
625
- this.authService.loginWithToken(token, 'facebook').subscribe(() => {
626
- this.appRef.tick();
627
- this.login.emit(true);
628
- });
629
- }
630
- loadSDKFacebook() {
631
- if (document.getElementById('facebook-jssdk')) {
632
- return;
633
- }
634
- const urlSDK = 'https://connect.facebook.net/fr_CA/sdk.js#xfbml=1&version=v2.9';
635
- const fjs = document.getElementsByTagName('script')[0];
636
- const js = document.createElement('script');
637
- js.id = 'facebook-jssdk';
638
- js.src = `${urlSDK}&appId=${this.options.appId}`;
639
- js.onload = () => {
640
- this.subscribeEvents();
641
- };
642
- fjs.parentNode.insertBefore(js, fjs);
643
- }
644
- }
645
- AuthFacebookComponent.ɵfac = function AuthFacebookComponent_Factory(t) { return new (t || AuthFacebookComponent)(i0.ɵɵdirectiveInject(AuthService), i0.ɵɵdirectiveInject(i2.ConfigService), i0.ɵɵdirectiveInject(i0.ApplicationRef)); };
646
- AuthFacebookComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AuthFacebookComponent, selectors: [["igo-auth-facebook"]], outputs: { login: "login" }, decls: 1, vars: 0, consts: [["scope", "public_profile,email", "data-max-rows", "1", "data-size", "large", "data-button-type", "login_with", "data-show-faces", "false", "data-auto-logout-link", "false", "data-use-continue-as", "false", 1, "fb-login-button"]], template: function AuthFacebookComponent_Template(rf, ctx) { if (rf & 1) {
647
- i0.ɵɵelement(0, "div", 0);
648
- } }, styles: ["[_nghost-%COMP%]{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-3px}"], changeDetection: 0 });
649
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthFacebookComponent, [{
650
- type: Component,
651
- args: [{
652
- selector: 'igo-auth-facebook',
653
- templateUrl: './auth-facebook.component.html',
654
- styleUrls: ['./auth-facebook.component.scss'],
655
- changeDetection: ChangeDetectionStrategy.OnPush
656
- }]
657
- }], function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }]; }, { login: [{
658
- type: Output
659
- }] }); })();
660
-
661
- function AuthInternComponent_button_12_Template(rf, ctx) { if (rf & 1) {
662
- const _r3 = i0.ɵɵgetCurrentView();
663
- i0.ɵɵelementStart(0, "button", 7);
664
- i0.ɵɵlistener("click", function AuthInternComponent_button_12_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r2 = i0.ɵɵnextContext(); return ctx_r2.loginAnonymous(); });
665
- i0.ɵɵtext(1);
666
- i0.ɵɵpipe(2, "translate");
667
- i0.ɵɵelementEnd();
668
- } if (rf & 2) {
669
- const ctx_r0 = i0.ɵɵnextContext();
670
- i0.ɵɵproperty("disabled", ctx_r0.loading);
671
- i0.ɵɵadvance(1);
672
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2, "igo.auth.accessAnonymous"), " ");
673
- } }
674
- function AuthInternComponent_div_13_Template(rf, ctx) { if (rf & 1) {
675
- i0.ɵɵelementStart(0, "div");
676
- i0.ɵɵelement(1, "br");
677
- i0.ɵɵelementStart(2, "font", 8);
678
- i0.ɵɵtext(3);
679
- i0.ɵɵelementEnd();
680
- i0.ɵɵelementEnd();
681
- } if (rf & 2) {
682
- const ctx_r1 = i0.ɵɵnextContext();
683
- i0.ɵɵadvance(3);
684
- i0.ɵɵtextInterpolate(ctx_r1.error);
685
- } }
686
- class AuthInternComponent {
687
- constructor(auth, languageService, fb) {
688
- this.auth = auth;
689
- this.languageService = languageService;
690
- this._allowAnonymous = true;
691
- this.error = '';
692
- this.loading = false;
693
- this.login = new EventEmitter();
694
- this.form = fb.group({
695
- username: ['', Validators.required],
696
- password: ['', Validators.required]
697
- });
698
- }
699
- get allowAnonymous() {
700
- return this._allowAnonymous;
701
- }
702
- set allowAnonymous(value) {
703
- this._allowAnonymous = value;
704
- }
705
- loginUser(values) {
706
- this.loading = true;
707
- this.auth.login(values.username, values.password).subscribe(() => {
708
- this.login.emit(true);
709
- this.loading = false;
710
- }, (error) => {
711
- try {
712
- this.languageService.translate
713
- .get('igo.auth.error.' + error.error.message)
714
- .subscribe(errorMsg => (this.error = errorMsg));
715
- }
716
- catch (e) {
717
- this.error = error.error.message;
718
- }
719
- this.loading = false;
720
- });
721
- return false;
722
- }
723
- loginAnonymous() {
724
- this.auth.loginAnonymous().subscribe(() => {
725
- this.login.emit(true);
726
- });
727
- }
728
- }
729
- AuthInternComponent.ɵfac = function AuthInternComponent_Factory(t) { return new (t || AuthInternComponent)(i0.ɵɵdirectiveInject(AuthService), i0.ɵɵdirectiveInject(i2.LanguageService), i0.ɵɵdirectiveInject(i3$2.FormBuilder)); };
730
- AuthInternComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AuthInternComponent, selectors: [["igo-auth-intern"]], inputs: { allowAnonymous: "allowAnonymous" }, outputs: { login: "login" }, decls: 14, vars: 12, consts: [["role", "form", 3, "formGroup", "ngSubmit"], [1, "full-width"], ["matInput", "", "required", "", "formControlName", "username", 3, "placeholder"], ["matInput", "", "required", "", "type", "password", "formControlName", "password", 3, "placeholder"], ["mat-raised-button", "", "type", "submit"], ["mat-raised-button", "", "class", "anonymous", "type", "button", 3, "disabled", "click", 4, "ngIf"], [4, "ngIf"], ["mat-raised-button", "", "type", "button", 1, "anonymous", 3, "disabled", "click"], ["size", "3", "color", "red"]], template: function AuthInternComponent_Template(rf, ctx) { if (rf & 1) {
731
- i0.ɵɵelementStart(0, "form", 0);
732
- i0.ɵɵlistener("ngSubmit", function AuthInternComponent_Template_form_ngSubmit_0_listener() { return ctx.loginUser(ctx.form.value); });
733
- i0.ɵɵelementStart(1, "div");
734
- i0.ɵɵelementStart(2, "mat-form-field", 1);
735
- i0.ɵɵelement(3, "input", 2);
736
- i0.ɵɵpipe(4, "translate");
737
- i0.ɵɵelementEnd();
738
- i0.ɵɵelementEnd();
739
- i0.ɵɵelementStart(5, "div");
740
- i0.ɵɵelementStart(6, "mat-form-field", 1);
741
- i0.ɵɵelement(7, "input", 3);
742
- i0.ɵɵpipe(8, "translate");
743
- i0.ɵɵelementEnd();
744
- i0.ɵɵelementEnd();
745
- i0.ɵɵelementStart(9, "button", 4);
746
- i0.ɵɵtext(10);
747
- i0.ɵɵpipe(11, "translate");
748
- i0.ɵɵelementEnd();
749
- i0.ɵɵtemplate(12, AuthInternComponent_button_12_Template, 3, 4, "button", 5);
750
- i0.ɵɵtemplate(13, AuthInternComponent_div_13_Template, 4, 1, "div", 6);
751
- i0.ɵɵelementEnd();
752
- } if (rf & 2) {
753
- i0.ɵɵproperty("formGroup", ctx.form);
754
- i0.ɵɵadvance(3);
755
- i0.ɵɵpropertyInterpolate("placeholder", i0.ɵɵpipeBind1(4, 6, "igo.auth.user"));
756
- i0.ɵɵadvance(4);
757
- i0.ɵɵpropertyInterpolate("placeholder", i0.ɵɵpipeBind1(8, 8, "igo.auth.password"));
758
- i0.ɵɵadvance(3);
759
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(11, 10, "igo.auth.login"));
760
- i0.ɵɵadvance(2);
761
- i0.ɵɵproperty("ngIf", ctx.allowAnonymous);
762
- i0.ɵɵadvance(1);
763
- i0.ɵɵproperty("ngIf", ctx.error);
764
- } }, directives: [i3$2.ɵNgNoValidate, i3$2.NgControlStatusGroup, i3$2.FormGroupDirective, i4$1.MatFormField, i5$1.MatInput, i3$2.DefaultValueAccessor, i3$2.RequiredValidator, i3$2.NgControlStatus, i3$2.FormControlName, i4.MatButton, i1$1.NgIf], pipes: [i6.TranslatePipe], styles: [".full-width[_ngcontent-%COMP%]{width:100%}.anonymous[_ngcontent-%COMP%]{margin-left:10px}"] });
765
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthInternComponent, [{
766
- type: Component,
767
- args: [{
768
- selector: 'igo-auth-intern',
769
- templateUrl: './auth-intern.component.html',
770
- styleUrls: ['./auth-intern.component.scss'],
771
- changeDetection: ChangeDetectionStrategy.Default
772
- }]
773
- }], function () { return [{ type: AuthService }, { type: i2.LanguageService }, { type: i3$2.FormBuilder }]; }, { allowAnonymous: [{
774
- type: Input
775
- }], login: [{
776
- type: Output
777
- }] }); })();
778
-
779
751
  function AuthFormComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
780
752
  i0.ɵɵelement(0, "div", 3);
781
753
  } }
782
754
  function AuthFormComponent_div_0_div_2_igo_auth_google_4_Template(rf, ctx) { if (rf & 1) {
783
755
  const _r11 = i0.ɵɵgetCurrentView();
784
756
  i0.ɵɵelementStart(0, "igo-auth-google", 7);
785
- 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 ctx_r10.onLogin(); });
757
+ 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()); });
786
758
  i0.ɵɵelementEnd();
787
759
  } }
788
760
  function AuthFormComponent_div_0_div_2_igo_auth_microsoft_5_Template(rf, ctx) { if (rf & 1) {
789
761
  const _r13 = i0.ɵɵgetCurrentView();
790
762
  i0.ɵɵelementStart(0, "igo-auth-microsoft", 7);
791
- 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 ctx_r12.onLogin(); });
763
+ 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()); });
792
764
  i0.ɵɵelementEnd();
793
765
  } }
794
766
  function AuthFormComponent_div_0_div_2_igo_auth_microsoftb2c_6_Template(rf, ctx) { if (rf & 1) {
795
767
  const _r15 = i0.ɵɵgetCurrentView();
796
768
  i0.ɵɵelementStart(0, "igo-auth-microsoftb2c", 7);
797
- 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 ctx_r14.onLogin(); });
769
+ 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()); });
798
770
  i0.ɵɵelementEnd();
799
771
  } }
800
772
  function AuthFormComponent_div_0_div_2_igo_auth_facebook_7_Template(rf, ctx) { if (rf & 1) {
801
773
  const _r17 = i0.ɵɵgetCurrentView();
802
774
  i0.ɵɵelementStart(0, "igo-auth-facebook", 7);
803
- 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 ctx_r16.onLogin(); });
775
+ 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()); });
804
776
  i0.ɵɵelementEnd();
805
777
  } }
806
778
  function AuthFormComponent_div_0_div_2_igo_auth_intern_8_Template(rf, ctx) { if (rf & 1) {
807
779
  const _r19 = i0.ɵɵgetCurrentView();
808
780
  i0.ɵɵelementStart(0, "igo-auth-intern", 8);
809
- 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 ctx_r18.onLogin(); });
781
+ 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()); });
810
782
  i0.ɵɵelementEnd();
811
783
  } if (rf & 2) {
812
784
  const ctx_r9 = i0.ɵɵnextContext(3);
813
785
  i0.ɵɵproperty("allowAnonymous", ctx_r9.options.allowAnonymous);
814
786
  } }
815
787
  function AuthFormComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
816
- i0.ɵɵelementStart(0, "div", 4);
817
- i0.ɵɵelementStart(1, "h1");
788
+ i0.ɵɵelementStart(0, "div", 4)(1, "h1");
818
789
  i0.ɵɵtext(2);
819
790
  i0.ɵɵpipe(3, "translate");
820
791
  i0.ɵɵelementEnd();
@@ -841,17 +812,15 @@ function AuthFormComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
841
812
  } }
842
813
  function AuthFormComponent_div_0_div_3_Template(rf, ctx) { if (rf & 1) {
843
814
  const _r21 = i0.ɵɵgetCurrentView();
844
- i0.ɵɵelementStart(0, "div", 4);
845
- i0.ɵɵelementStart(1, "p");
815
+ i0.ɵɵelementStart(0, "div", 4)(1, "p");
846
816
  i0.ɵɵtext(2);
847
817
  i0.ɵɵpipe(3, "translate");
848
818
  i0.ɵɵelementEnd();
849
819
  i0.ɵɵelementStart(4, "button", 9);
850
- i0.ɵɵlistener("click", function AuthFormComponent_div_0_div_3_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r21); const ctx_r20 = i0.ɵɵnextContext(2); return ctx_r20.logout(); });
820
+ 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()); });
851
821
  i0.ɵɵtext(5);
852
822
  i0.ɵɵpipe(6, "translate");
853
- i0.ɵɵelementEnd();
854
- i0.ɵɵelementEnd();
823
+ i0.ɵɵelementEnd()();
855
824
  } if (rf & 2) {
856
825
  const ctx_r3 = i0.ɵɵnextContext(2);
857
826
  i0.ɵɵadvance(2);
@@ -862,7 +831,7 @@ function AuthFormComponent_div_0_div_3_Template(rf, ctx) { if (rf & 1) {
862
831
  function AuthFormComponent_div_0_div_4_button_4_Template(rf, ctx) { if (rf & 1) {
863
832
  const _r24 = i0.ɵɵgetCurrentView();
864
833
  i0.ɵɵelementStart(0, "button", 9);
865
- 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 ctx_r23.home(); });
834
+ 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()); });
866
835
  i0.ɵɵtext(1);
867
836
  i0.ɵɵpipe(2, "translate");
868
837
  i0.ɵɵelementEnd();
@@ -871,8 +840,7 @@ function AuthFormComponent_div_0_div_4_button_4_Template(rf, ctx) { if (rf & 1)
871
840
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "igo.auth.home"));
872
841
  } }
873
842
  function AuthFormComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
874
- i0.ɵɵelementStart(0, "div", 4);
875
- i0.ɵɵelementStart(1, "p");
843
+ i0.ɵɵelementStart(0, "div", 4)(1, "p");
876
844
  i0.ɵɵtext(2);
877
845
  i0.ɵɵpipe(3, "translate");
878
846
  i0.ɵɵelementEnd();
@@ -1022,15 +990,10 @@ AuthFormComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AuthFormC
1022
990
  i0.ɵɵtemplate(0, AuthFormComponent_div_0_Template, 5, 4, "div", 0);
1023
991
  } if (rf & 2) {
1024
992
  i0.ɵɵproperty("ngIf", ctx.visible);
1025
- } }, directives: [i1$1.NgIf, AuthGoogleComponent, AuthMicrosoftComponent, AuthMicrosoftb2cComponent, AuthFacebookComponent, AuthInternComponent, i4.MatButton], pipes: [i6.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%}"] });
993
+ } }, 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%}"] });
1026
994
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthFormComponent, [{
1027
995
  type: Component,
1028
- args: [{
1029
- selector: 'igo-auth-form',
1030
- templateUrl: './auth-form.component.html',
1031
- styleUrls: ['./auth-form.component.scss'],
1032
- changeDetection: ChangeDetectionStrategy.Default
1033
- }]
996
+ args: [{ selector: 'igo-auth-form', changeDetection: ChangeDetectionStrategy.Default, template: "<div *ngIf=\"visible\">\r\n <div *ngIf=\"!auth.logged && backgroundDisable\" class=\"backgroundDisable\"></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 </igo-auth-google>\r\n <igo-auth-microsoft\r\n *ngIf=\"options.microsoft && options.microsoft.enabled !== false\"\r\n (login)=\"onLogin()\">\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 </igo-auth-microsoftb2c>\r\n <igo-auth-facebook\r\n *ngIf=\"options.facebook && options.facebook.enabled !== false\"\r\n (login)=\"onLogin()\">\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 </igo-auth-intern>\r\n </div>\r\n\r\n <div *ngIf=\"auth.logged && showAlreadyConnectedDiv\" class=\"login center-block\">\r\n <p>{{'igo.auth.welcome' |\u00A0translate: user}}</p>\r\n <button mat-raised-button type=\"button\" (click)=\"logout()\">{{'igo.auth.signOut' |\u00A0translate}}</button>\r\n </div>\r\n\r\n <div *ngIf=\"showLogoutDiv\" class=\"login center-block\">\r\n <p>{{'igo.auth.deconnection' |\u00A0translate}}</p>\r\n <button *ngIf=\"options.homeRoute\" mat-raised-button type=\"button\" (click)=\"home()\">{{'igo.auth.home' |\u00A0translate}}</button>\r\n </div>\r\n\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"] }]
1034
997
  }], function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i3.Router, decorators: [{
1035
998
  type: Optional
1036
999
  }] }]; }, { backgroundDisable: [{
@@ -1496,7 +1459,7 @@ class AuthRoutingModule {
1496
1459
  }
1497
1460
  AuthRoutingModule.ɵfac = function AuthRoutingModule_Factory(t) { return new (t || AuthRoutingModule)(); };
1498
1461
  AuthRoutingModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AuthRoutingModule });
1499
- AuthRoutingModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [], imports: [[RouterModule.forChild(routes)], RouterModule] });
1462
+ AuthRoutingModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [RouterModule.forChild(routes), RouterModule] });
1500
1463
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthRoutingModule, [{
1501
1464
  type: NgModule,
1502
1465
  args: [{
@@ -1529,16 +1492,14 @@ class IgoAuthModule {
1529
1492
  }
1530
1493
  IgoAuthModule.ɵfac = function IgoAuthModule_Factory(t) { return new (t || IgoAuthModule)(); };
1531
1494
  IgoAuthModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoAuthModule });
1532
- IgoAuthModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
1533
- CommonModule,
1534
- ReactiveFormsModule,
1535
- MatFormFieldModule,
1536
- MatInputModule,
1537
- MatIconModule,
1538
- MatButtonModule,
1539
- IgoLanguageModule,
1540
- MsalModule
1541
- ]] });
1495
+ IgoAuthModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
1496
+ ReactiveFormsModule,
1497
+ MatFormFieldModule,
1498
+ MatInputModule,
1499
+ MatIconModule,
1500
+ MatButtonModule,
1501
+ IgoLanguageModule,
1502
+ MsalModule] });
1542
1503
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoAuthModule, [{
1543
1504
  type: NgModule,
1544
1505
  args: [{
@@ -1588,4 +1549,4 @@ IgoAuthModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
1588
1549
  */
1589
1550
 
1590
1551
  export { AdminGuard, AuthFormComponent, AuthGuard, AuthInterceptor, AuthRoutingModule, AuthService, AuthStorageService, IgoAuthModule, LoggedGuard, MSALAngularConfigFactory, MSALAngularConfigFactoryb2c, MSALConfigFactory, MSALConfigFactoryb2c, ProfilsGuard, ProtectedDirective, TokenService, provideAuthMicrosoft };
1591
- //# sourceMappingURL=igo2-auth.js.map
1552
+ //# sourceMappingURL=igo2-auth.mjs.map