@igo2/auth 16.0.0-rc.1 → 16.0.0-rc.3

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 (48) hide show
  1. package/esm2022/lib/auth-form/auth-facebook.component.mjs +3 -3
  2. package/esm2022/lib/auth-form/auth-form.component.mjs +5 -5
  3. package/esm2022/lib/auth-form/auth-google.component.mjs +3 -3
  4. package/esm2022/lib/auth-form/auth-intern.component.mjs +5 -5
  5. package/esm2022/lib/auth-form/auth-microsoft.component.mjs +7 -7
  6. package/esm2022/lib/auth-form/auth-microsoftb2c.component.mjs +7 -7
  7. package/esm2022/lib/auth-routing.module.mjs +1 -1
  8. package/esm2022/lib/auth.module.mjs +10 -10
  9. package/esm2022/lib/environment/environment.interface.mjs +2 -0
  10. package/esm2022/lib/environment/index.mjs +2 -0
  11. package/esm2022/lib/shared/admin.guard.mjs +2 -2
  12. package/esm2022/lib/shared/auth-microsoft.provider.mjs +3 -3
  13. package/esm2022/lib/shared/auth-msalBroadcastServiceb2c.service.mjs +2 -2
  14. package/esm2022/lib/shared/auth-msalServiceb2c.service..mjs +3 -3
  15. package/esm2022/lib/shared/auth.guard.mjs +2 -2
  16. package/esm2022/lib/shared/auth.interceptor.mjs +9 -8
  17. package/esm2022/lib/shared/auth.interface.mjs +1 -1
  18. package/esm2022/lib/shared/auth.service.mjs +17 -18
  19. package/esm2022/lib/shared/index.mjs +13 -0
  20. package/esm2022/lib/shared/logged.guard.mjs +2 -2
  21. package/esm2022/lib/shared/profils.guard.mjs +3 -3
  22. package/esm2022/lib/shared/protected.directive.mjs +1 -1
  23. package/esm2022/lib/shared/storage.service.mjs +3 -3
  24. package/esm2022/lib/shared/token.service.mjs +2 -2
  25. package/esm2022/public_api.mjs +2 -1
  26. package/fesm2022/igo2-auth.mjs +30 -30
  27. package/fesm2022/igo2-auth.mjs.map +1 -1
  28. package/lib/auth-form/auth-form.component.d.ts +1 -1
  29. package/lib/auth-form/auth-intern.component.d.ts +2 -2
  30. package/lib/auth-form/auth-microsoft.component.d.ts +1 -1
  31. package/lib/auth-form/auth-microsoftb2c.component.d.ts +1 -1
  32. package/lib/environment/environment.interface.d.ts +5 -0
  33. package/lib/environment/index.d.ts +1 -0
  34. package/lib/shared/admin.guard.d.ts +1 -1
  35. package/lib/shared/auth-microsoft.provider.d.ts +2 -2
  36. package/lib/shared/auth-msalBroadcastServiceb2c.service.d.ts +1 -1
  37. package/lib/shared/auth-msalServiceb2c.service..d.ts +2 -2
  38. package/lib/shared/auth.guard.d.ts +1 -1
  39. package/lib/shared/auth.interceptor.d.ts +3 -2
  40. package/lib/shared/auth.interface.d.ts +3 -6
  41. package/lib/shared/auth.service.d.ts +3 -2
  42. package/lib/shared/index.d.ts +12 -0
  43. package/lib/shared/logged.guard.d.ts +1 -1
  44. package/lib/shared/profils.guard.d.ts +1 -1
  45. package/lib/shared/storage.service.d.ts +2 -2
  46. package/locale/en.auth.json +28 -28
  47. package/package.json +3 -3
  48. package/public_api.d.ts +1 -0
@@ -1,6 +1,6 @@
1
1
  import { Injectable, Injector } from '@angular/core';
2
- import jwtDecode from 'jwt-decode';
3
2
  import { ConfigService } from '@igo2/core';
3
+ import jwtDecode from 'jwt-decode';
4
4
  import * as i0 from "@angular/core";
5
5
  export class TokenService {
6
6
  injector;
@@ -45,4 +45,4 @@ export class TokenService {
45
45
  providedIn: 'root'
46
46
  }]
47
47
  }], function () { return [{ type: i0.Injector }]; }, null); })();
48
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2F1dGgvc3JjL2xpYi9zaGFyZWQvdG9rZW4uc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBR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NlKTtcclxuICAgIHRoaXMub3B0aW9ucyA9IGNvbmZpZy5nZXRDb25maWcoJ2F1dGgnKTtcclxuICAgIHRoaXMudG9rZW5LZXkgPSB0aGlzLm9wdGlvbnM/LnRva2VuS2V5O1xyXG4gIH1cclxuXHJcbiAgc2V0KHRva2VuOiBzdHJpbmcpIHtcclxuICAgIGxvY2FsU3RvcmFnZS5zZXRJdGVtKHRoaXMudG9rZW5LZXksIHRva2VuKTtcclxuICB9XHJcblxyXG4gIHJlbW92ZSgpIHtcclxuICAgIGxvY2FsU3RvcmFnZS5yZW1vdmVJdGVtKHRoaXMudG9rZW5LZXkpO1xyXG4gIH1cclxuXHJcbiAgZ2V0KCk6IHN0cmluZyB7XHJcbiAgICByZXR1cm4gbG9jYWxTdG9yYWdlLmdldEl0ZW0odGhpcy50b2tlbktleSk7XHJcbiAgfVxyXG5cclxuICBkZWNvZGUoKSB7XHJcbiAgICBjb25zdCB0b2tlbiA9IHRoaXMuZ2V0KCk7XHJcbiAgICBpZiAoIXRva2VuKSB7XHJcbiAgICAgIHJldHVybjtcclxuICAgIH1cclxuICAgIHJldHVybiBqd3REZWNvZGUodG9rZW4pO1xyXG4gIH1cclxuXHJcbiAgaXNFeHBpcmVkKCkge1xyXG4gICAgY29uc3Qgand0ID0gdGhpcy5kZWNvZGUoKTtcclxuICAgIGNvbnN0IGN1cnJlbnRUaW1lID0gbmV3IERhdGUoKS5nZXRUaW1lKCkgLyAxMDAwO1xyXG4gICAgaWYgKGp3dCAmJiBjdXJyZW50VGltZSA8IGp3dC5leHApIHtcclxuICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuIHRydWU7XHJcbiAgfVxyXG59XHJcbiJdfQ==
@@ -2,6 +2,7 @@
2
2
  * Public API Surface of auth
3
3
  */
4
4
  export { AuthFormComponent } from './lib/auth-form';
5
+ export * from './lib/environment';
5
6
  export * from './lib/shared/auth.service';
6
7
  export * from './lib/shared/logged.guard';
7
8
  export * from './lib/shared/auth.guard';
@@ -16,4 +17,4 @@ export * from './lib/shared/storage.interface';
16
17
  export * from './lib/shared/storage.service';
17
18
  export * from './lib/auth-routing.module';
18
19
  export * from './lib/auth.module';
19
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3BhY2thZ2VzL2F1dGgvc3JjL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUNwRCxjQUFjLDJCQUEyQixDQUFDO0FBQzFDLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsNEJBQTRCLENBQUM7QUFDM0MsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMsc0NBQXNDLENBQUM7QUFDckQsY0FBYyxrQ0FBa0MsQ0FBQztBQUNqRCxjQUFjLDRCQUE0QixDQUFDO0FBQzNDLGNBQWMsZ0NBQWdDLENBQUM7QUFDL0MsY0FBYyw4QkFBOEIsQ0FBQztBQUM3QyxjQUFjLDJCQUEyQixDQUFDO0FBQzFDLGNBQWMsbUJBQW1CLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIGF1dGhcbiAqL1xuXG5leHBvcnQgeyBBdXRoRm9ybUNvbXBvbmVudCB9IGZyb20gJy4vbGliL2F1dGgtZm9ybSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9zaGFyZWQvYXV0aC5zZXJ2aWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NoYX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F1dGguaW50ZXJmYWNlJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvc2hhcmVkL2F1dGgtbWljcm9zb2Z0LnByb3ZpZGVyJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvc2hhcmVkL3Byb3RlY3RlZC5kaXJlY3RpdmUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zaGFyZWQvdG9rZW4uc2VydmljZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NoYXJlZC9zdG9yYWdlLmludGVyZmFjZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NoYXJlZC9zdG9yYWdlLnNlcnZpY2UnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9hdXRoLXJvdXRpbmcubW9kdWxlJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvYXV0aC5tb2R1bGUnO1xyXG4iXX0=
@@ -2,14 +2,14 @@ import * as i0 from '@angular/core';
2
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
- import { tap, catchError, filter, takeUntil, map } from 'rxjs/operators';
6
5
  import * as i2 from '@igo2/core';
7
6
  import { ConfigService, BaseStorage, StorageScope, StorageService, IgoLanguageModule } from '@igo2/core';
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
+ import { Base64 } from '@igo2/utils';
10
11
  import { BehaviorSubject, of, Subject, from } from 'rxjs';
11
12
  import { globalCacheBusterNotifier } from 'ts-cacheable';
12
- import { Base64 } from '@igo2/utils';
13
13
  import jwtDecode from 'jwt-decode';
14
14
  import * as i1$1 from '@angular/common';
15
15
  import { CommonModule } from '@angular/common';
@@ -85,8 +85,9 @@ class AuthService {
85
85
  redirectUrl;
86
86
  languageForce = false;
87
87
  anonymous = false;
88
+ authOptions;
88
89
  get hasAuthService() {
89
- return this.config.getConfig('auth.url') !== undefined;
90
+ return this.authOptions?.url !== undefined;
90
91
  }
91
92
  constructor(http, tokenService, config, languageService, messageService, router) {
92
93
  this.http = http;
@@ -95,6 +96,7 @@ class AuthService {
95
96
  this.languageService = languageService;
96
97
  this.messageService = messageService;
97
98
  this.router = router;
99
+ this.authOptions = this.config.getConfig('auth');
98
100
  this.authenticate$.next(this.authenticated);
99
101
  this.authenticate$.subscribe((authenticated) => {
100
102
  this.logged$.next(authenticated);
@@ -124,8 +126,7 @@ class AuthService {
124
126
  return of(true);
125
127
  }
126
128
  refresh() {
127
- const url = this.config.getConfig('auth.url');
128
- return this.http.post(`${url}/refresh`, {}).pipe(tap((data) => {
129
+ return this.http.post(`${this.authOptions?.url}/refresh`, {}).pipe(tap((data) => {
129
130
  this.tokenService.set(data.token);
130
131
  }), catchError((err) => {
131
132
  err.error.caught = true;
@@ -155,9 +156,8 @@ class AuthService {
155
156
  return;
156
157
  }
157
158
  const redirectUrl = this.redirectUrl || this.router.url;
158
- const options = this.config.getConfig('auth') || {};
159
- if (redirectUrl === options.loginRoute) {
160
- const homeRoute = options.homeRoute || '/';
159
+ if (redirectUrl === this.authOptions.loginRoute) {
160
+ const homeRoute = this.authOptions.homeRoute || '/';
161
161
  this.router.navigateByUrl(homeRoute);
162
162
  }
163
163
  else if (redirectUrl) {
@@ -165,16 +165,14 @@ class AuthService {
165
165
  }
166
166
  }
167
167
  getUserInfo() {
168
- const url = this.config.getConfig('auth.url') + '/info';
168
+ const url = this.authOptions?.url + '/info';
169
169
  return this.http.get(url);
170
170
  }
171
171
  getProfils() {
172
- const url = this.config.getConfig('auth.url');
173
- return this.http.get(`${url}/profils`);
172
+ return this.http.get(`${this.authOptions?.url}/profils`);
174
173
  }
175
174
  updateUser(user) {
176
- const url = this.config.getConfig('auth.url');
177
- return this.http.patch(url, user);
175
+ return this.http.patch(this.authOptions?.url, user);
178
176
  }
179
177
  encodePassword(password) {
180
178
  return Base64.encode(password);
@@ -197,8 +195,9 @@ class AuthService {
197
195
  return false;
198
196
  }
199
197
  loginCall(body, headers) {
200
- const url = this.config.getConfig('auth.url');
201
- return this.http.post(`${url}/login`, body, { headers }).pipe(tap((data) => {
198
+ return this.http
199
+ .post(`${this.authOptions?.url}/login`, body, { headers })
200
+ .pipe(tap((data) => {
202
201
  this.tokenService.set(data.token);
203
202
  const tokenDecoded = this.decodeToken();
204
203
  if (tokenDecoded && tokenDecoded.user) {
@@ -324,7 +323,7 @@ class AuthGoogleComponent {
324
323
  }
325
324
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthGoogleComponent, [{
326
325
  type: Component,
327
- args: [{ selector: 'igo-auth-google', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"g-signin2 google-login-button\"\n data-height=\"40\"\n data-width=\"265\"\n data-longtitle=\"true\"\n></div>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block}.google-login-button ::ng-deep .abcRioButton{color:#000000de}\n"] }]
326
+ 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"] }]
328
327
  }], function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i2.LanguageService }, { type: i0.ApplicationRef }]; }, { login: [{
329
328
  type: Output
330
329
  }] }); })();
@@ -443,7 +442,7 @@ class AuthInternComponent {
443
442
  }
444
443
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthInternComponent, [{
445
444
  type: Component,
446
- args: [{ selector: 'igo-auth-intern', changeDetection: ChangeDetectionStrategy.Default, template: "<form [formGroup]=\"form\" role=\"form\" (ngSubmit)=\"loginUser(form.value)\">\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>{{ 'igo.auth.user' | translate }}</mat-label>\n <input\n matInput\n required\n placeholder=\"{{ 'igo.auth.user' | translate }}\"\n formControlName=\"username\"\n />\n </mat-form-field>\n </div>\n\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>{{ 'igo.auth.password' | translate }}</mat-label>\n <input\n matInput\n required\n type=\"password\"\n placeholder=\"{{ 'igo.auth.password' | translate }}\"\n formControlName=\"password\"\n />\n </mat-form-field>\n </div>\n\n <button mat-raised-button type=\"submit\">\n {{ 'igo.auth.login' | translate }}\n </button>\n <button\n *ngIf=\"allowAnonymous\"\n mat-raised-button\n class=\"anonymous\"\n type=\"button\"\n [disabled]=\"loading\"\n (click)=\"loginAnonymous()\"\n >\n {{ 'igo.auth.accessAnonymous' | translate }}\n </button>\n <div *ngIf=\"error\">\n <br />\n <font size=\"3\" color=\"red\">{{ error }}</font>\n </div>\n</form>\n", styles: [".full-width{width:100%}.anonymous{margin-left:10px}\n"] }]
445
+ 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"] }]
447
446
  }], function () { return [{ type: AuthService }, { type: i2.LanguageService }, { type: i3$1.UntypedFormBuilder }]; }, { allowAnonymous: [{
448
447
  type: Input
449
448
  }], login: [{
@@ -506,7 +505,7 @@ class AuthFacebookComponent {
506
505
  }
507
506
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthFacebookComponent, [{
508
507
  type: Component,
509
- args: [{ selector: 'igo-auth-facebook', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n scope=\"public_profile,email\"\n class=\"fb-login-button\"\n data-max-rows=\"1\"\n data-size=\"large\"\n data-button-type=\"login_with\"\n data-show-faces=\"false\"\n data-auto-logout-link=\"false\"\n data-use-continue-as=\"false\"\n></div>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-3px}\n"] }]
508
+ 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"] }]
510
509
  }], function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }]; }, { login: [{
511
510
  type: Output
512
511
  }] }); })();
@@ -596,7 +595,7 @@ class AuthMicrosoftComponent {
596
595
  }
597
596
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthMicrosoftComponent, [{
598
597
  type: Component,
599
- args: [{ selector: 'igo-auth-microsoft', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n class=\"microsoft-login-button\"\n mat-raised-button\n (click)=\"loginMicrosoft()\"\n>\n <mat-icon svgIcon=\"microsoft\"></mat-icon>\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\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"] }]
598
+ 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"] }]
600
599
  }], function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }, { type: i3$2.MsalService }, { type: undefined, decorators: [{
601
600
  type: Inject,
602
601
  args: [MSAL_GUARD_CONFIG]
@@ -803,7 +802,7 @@ class AuthMicrosoftb2cComponent {
803
802
  }
804
803
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthMicrosoftb2cComponent, [{
805
804
  type: Component,
806
- args: [{ selector: 'igo-auth-microsoftb2c', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n class=\"microsoft-login-button\"\n mat-raised-button\n (click)=\"loginMicrosoftb2c()\"\n>\n <mat-icon svgIcon=\"microsoft\"></mat-icon>\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\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"] }]
805
+ 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"] }]
807
806
  }], function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }, { type: MsalServiceb2c }, { type: undefined, decorators: [{
808
807
  type: Inject,
809
808
  args: [MSAL_GUARD_CONFIG]
@@ -1063,7 +1062,7 @@ class AuthFormComponent {
1063
1062
  }
1064
1063
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthFormComponent, [{
1065
1064
  type: Component,
1066
- args: [{ selector: 'igo-auth-form', changeDetection: ChangeDetectionStrategy.Default, template: "<div *ngIf=\"visible\">\n <div\n *ngIf=\"!auth.logged && backgroundDisable\"\n class=\"backgroundDisable\"\n ></div>\n\n <div *ngIf=\"!auth.logged && showLoginDiv\" class=\"login center-block\">\n <h1>{{ 'igo.auth.connection' | translate }}</h1>\n\n <igo-auth-google\n *ngIf=\"options.google && options.google.enabled !== false\"\n (login)=\"onLogin()\"\n >\n </igo-auth-google>\n <igo-auth-microsoft\n *ngIf=\"options.microsoft && options.microsoft.enabled !== false\"\n (login)=\"onLogin()\"\n >\n </igo-auth-microsoft>\n <igo-auth-microsoftb2c\n *ngIf=\"options.microsoftb2c && options.microsoftb2c.enabled !== false\"\n (login)=\"onLogin()\"\n >\n </igo-auth-microsoftb2c>\n <igo-auth-facebook\n *ngIf=\"options.facebook && options.facebook.enabled !== false\"\n (login)=\"onLogin()\"\n >\n </igo-auth-facebook>\n <igo-auth-intern\n *ngIf=\"!options.intern || options.intern.enabled !== false\"\n [allowAnonymous]=\"options.allowAnonymous\"\n (login)=\"onLogin()\"\n >\n </igo-auth-intern>\n </div>\n\n <div\n *ngIf=\"auth.logged && showAlreadyConnectedDiv\"\n class=\"login center-block\"\n >\n <p>{{ 'igo.auth.welcome' | translate: user }}</p>\n <button mat-raised-button type=\"button\" (click)=\"logout()\">\n {{ 'igo.auth.signOut' | translate }}\n </button>\n </div>\n\n <div *ngIf=\"showLogoutDiv\" class=\"login center-block\">\n <p>{{ 'igo.auth.deconnection' | translate }}</p>\n <button\n *ngIf=\"options.homeRoute\"\n mat-raised-button\n type=\"button\"\n (click)=\"home()\"\n >\n {{ 'igo.auth.home' | translate }}\n </button>\n </div>\n</div>\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"] }]
1065
+ 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"] }]
1067
1066
  }], function () { return [{ type: AuthService }, { type: i2.ConfigService }, { type: i3.Router, decorators: [{
1068
1067
  type: Optional
1069
1068
  }] }]; }, { backgroundDisable: [{
@@ -1095,7 +1094,7 @@ class LoggedGuard {
1095
1094
  }
1096
1095
  this.authService.redirectUrl = state.url;
1097
1096
  const authConfig = this.config.getConfig('auth');
1098
- if (authConfig && authConfig.loginRoute) {
1097
+ if (authConfig?.loginRoute) {
1099
1098
  this.router.navigateByUrl(authConfig.loginRoute);
1100
1099
  }
1101
1100
  return false;
@@ -1125,7 +1124,7 @@ class AuthGuard {
1125
1124
  }
1126
1125
  this.authService.redirectUrl = state.url;
1127
1126
  const authConfig = this.config.getConfig('auth');
1128
- if (authConfig && authConfig.loginRoute) {
1127
+ if (authConfig?.loginRoute) {
1129
1128
  this.router.navigateByUrl(authConfig.loginRoute);
1130
1129
  }
1131
1130
  return false;
@@ -1156,7 +1155,7 @@ class AdminGuard {
1156
1155
  }
1157
1156
  this.authService.redirectUrl = state.url;
1158
1157
  const authConfig = this.config.getConfig('auth');
1159
- if (authConfig && authConfig.loginRoute) {
1158
+ if (authConfig?.loginRoute) {
1160
1159
  this.router.navigateByUrl(authConfig.loginRoute);
1161
1160
  }
1162
1161
  return false;
@@ -1189,7 +1188,7 @@ class ProfilsGuard {
1189
1188
  return true;
1190
1189
  }
1191
1190
  this.authService.redirectUrl = state.url;
1192
- if (authConfig && authConfig.loginRoute) {
1191
+ if (authConfig?.loginRoute) {
1193
1192
  this.router.navigateByUrl(authConfig.loginRoute);
1194
1193
  }
1195
1194
  return false;
@@ -1209,6 +1208,7 @@ class AuthInterceptor {
1209
1208
  config;
1210
1209
  tokenService;
1211
1210
  http;
1211
+ authOptions;
1212
1212
  refreshInProgress = false;
1213
1213
  trustHosts;
1214
1214
  hostsWithCredentials;
@@ -1217,11 +1217,11 @@ class AuthInterceptor {
1217
1217
  this.config = config;
1218
1218
  this.tokenService = tokenService;
1219
1219
  this.http = http;
1220
- this.trustHosts = this.config.getConfig('auth.trustHosts') || [];
1220
+ this.authOptions = this.config.getConfig('auth');
1221
+ this.trustHosts = this.authOptions?.trustHosts || [];
1221
1222
  this.trustHosts.push(window.location.hostname);
1222
- this.hostsWithCredentials =
1223
- this.config.getConfig('auth.hostsWithCredentials') || [];
1224
- this.hostsWithAuthByKey = this.config.getConfig('auth.hostsByKey') || [];
1223
+ this.hostsWithCredentials = this.authOptions?.hostsWithCredentials || [];
1224
+ this.hostsWithAuthByKey = this.authOptions?.hostsByKey || [];
1225
1225
  }
1226
1226
  intercept(originalReq, next) {
1227
1227
  const withCredentials = this.handleHostsWithCredentials(originalReq.url);
@@ -1340,7 +1340,7 @@ class AuthInterceptor {
1340
1340
  currentTime < jwt.exp &&
1341
1341
  currentTime > jwt.exp - 1800) {
1342
1342
  this.refreshInProgress = true;
1343
- const url = this.config.getConfig('auth.url');
1343
+ const url = this.authOptions?.url;
1344
1344
  return this.http.post(`${url}/refresh`, {}).subscribe((data) => {
1345
1345
  this.tokenService.set(data.token);
1346
1346
  this.refreshInProgress = false;