@igo2/auth 19.0.3 → 20.0.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/environment/index.d.ts +9 -5
  2. package/facebook/index.d.ts +25 -5
  3. package/fesm2022/igo2-auth-facebook.mjs +11 -14
  4. package/fesm2022/igo2-auth-facebook.mjs.map +1 -1
  5. package/fesm2022/igo2-auth-form.mjs +20 -27
  6. package/fesm2022/igo2-auth-form.mjs.map +1 -1
  7. package/fesm2022/igo2-auth-google.mjs +13 -17
  8. package/fesm2022/igo2-auth-google.mjs.map +1 -1
  9. package/fesm2022/igo2-auth-internal.mjs +18 -22
  10. package/fesm2022/igo2-auth-internal.mjs.map +1 -1
  11. package/fesm2022/igo2-auth-microsoft.mjs +44 -73
  12. package/fesm2022/igo2-auth-microsoft.mjs.map +1 -1
  13. package/fesm2022/igo2-auth-monitoring.mjs +10 -19
  14. package/fesm2022/igo2-auth-monitoring.mjs.map +1 -1
  15. package/fesm2022/igo2-auth.mjs +67 -103
  16. package/fesm2022/igo2-auth.mjs.map +1 -1
  17. package/form/index.d.ts +71 -5
  18. package/google/index.d.ts +32 -5
  19. package/index.d.ts +188 -5
  20. package/internal/index.d.ts +23 -5
  21. package/microsoft/index.d.ts +86 -5
  22. package/monitoring/index.d.ts +19 -5
  23. package/package.json +12 -12
  24. package/environment/environment.interface.d.ts +0 -6
  25. package/environment/public_api.d.ts +0 -1
  26. package/facebook/auth-facebook/auth-facebook.component.d.ts +0 -18
  27. package/facebook/public_api.d.ts +0 -2
  28. package/facebook/shared/auth-facebook.interface.d.ts +0 -4
  29. package/facebook/shared/index.d.ts +0 -1
  30. package/form/auth-form/auth-form.component.d.ts +0 -41
  31. package/form/auth-form.module.d.ts +0 -20
  32. package/form/public_api.d.ts +0 -3
  33. package/form/shared/auth-form.interface.d.ts +0 -9
  34. package/form/shared/index.d.ts +0 -1
  35. package/google/auth-google/auth-google.component.d.ts +0 -25
  36. package/google/public_api.d.ts +0 -2
  37. package/google/shared/auth-google.interface.d.ts +0 -5
  38. package/google/shared/index.d.ts +0 -1
  39. package/internal/auth-intern/auth-intern.component.d.ts +0 -21
  40. package/internal/public_api.d.ts +0 -1
  41. package/lib/auth.provider.d.ts +0 -3
  42. package/lib/shared/admin.guard.d.ts +0 -13
  43. package/lib/shared/auth-storage.interface.d.ts +0 -4
  44. package/lib/shared/auth-storage.service.d.ts +0 -18
  45. package/lib/shared/auth.guard.d.ts +0 -13
  46. package/lib/shared/auth.interceptor.d.ts +0 -25
  47. package/lib/shared/auth.interface.d.ts +0 -45
  48. package/lib/shared/auth.service.d.ts +0 -49
  49. package/lib/shared/index.d.ts +0 -11
  50. package/lib/shared/logged.guard.d.ts +0 -13
  51. package/lib/shared/profils.guard.d.ts +0 -13
  52. package/lib/shared/token.interface.d.ts +0 -5
  53. package/lib/shared/token.service.d.ts +0 -16
  54. package/microsoft/auth-microsoft/auth-microsoft.component.d.ts +0 -25
  55. package/microsoft/auth-microsoft.provider.d.ts +0 -12
  56. package/microsoft/auth-microsoftb2c/auth-microsoftb2c.component.d.ts +0 -25
  57. package/microsoft/auth-microsoftb2c/auth-msalBroadcastServiceb2c.service.d.ts +0 -15
  58. package/microsoft/auth-microsoftb2c/auth-msalServiceb2c.service.d.ts +0 -33
  59. package/microsoft/public_api.d.ts +0 -4
  60. package/microsoft/shared/auth-microsoft.interface.d.ts +0 -32
  61. package/microsoft/shared/index.d.ts +0 -1
  62. package/monitoring/auth-monitoring/auth-monitoring.provider.d.ts +0 -3
  63. package/monitoring/auth-monitoring/auth-monitoring.service.d.ts +0 -15
  64. package/monitoring/public_api.d.ts +0 -2
  65. package/public_api.d.ts +0 -2
@@ -1,38 +1,30 @@
1
- import * as i1 from '@igo2/auth';
2
- import { AuthFeatureKind } from '@igo2/auth';
3
- import * as i2 from '@igo2/core/config';
1
+ import { AuthService, AuthFeatureKind } from '@igo2/auth';
4
2
  import { ConfigService } from '@igo2/core/config';
5
- import * as i3 from '@azure/msal-angular';
6
- import { MsalBroadcastService, MSAL_GUARD_CONFIG, MSAL_INSTANCE, MsalService } from '@azure/msal-angular';
3
+ import { MsalService, MSAL_GUARD_CONFIG, MsalBroadcastService, MSAL_INSTANCE } from '@azure/msal-angular';
7
4
  import { PublicClientApplication, InteractionStatus, InteractionRequiredAuthError, WrapperSKU, EventMessageUtils, InteractionType } from '@azure/msal-browser';
8
5
  import * as i0 from '@angular/core';
9
- import { EventEmitter, Output, Inject, ChangeDetectionStrategy, Component, Injectable } from '@angular/core';
10
- import * as i4 from '@angular/material/button';
6
+ import { inject, ApplicationRef, EventEmitter, Output, ChangeDetectionStrategy, Component, Injectable } from '@angular/core';
7
+ import * as i1 from '@angular/material/button';
11
8
  import { MatButtonModule } from '@angular/material/button';
12
9
  import { MICROSOFT_ICON, IgoIconComponent } from '@igo2/common/icon';
13
10
  import { IgoLanguageModule } from '@igo2/core/language';
14
11
  import { Subject, from, BehaviorSubject } from 'rxjs';
15
12
  import { filter, takeUntil } from 'rxjs/operators';
16
- import * as i5 from '@ngx-translate/core';
17
- import * as i1$1 from '@angular/common';
13
+ import * as i2 from '@ngx-translate/core';
14
+ import { Location } from '@angular/common';
18
15
 
19
16
  class AuthMicrosoftComponent {
20
- authService;
21
- config;
22
- appRef;
23
- msalService;
24
- msalGuardConfig;
17
+ authService = inject(AuthService);
18
+ config = inject(ConfigService);
19
+ appRef = inject(ApplicationRef);
20
+ msalService = inject(MsalService);
21
+ msalGuardConfig = inject(MSAL_GUARD_CONFIG);
25
22
  options;
26
23
  _destroying$ = new Subject();
27
24
  login = new EventEmitter();
28
25
  broadcastService;
29
26
  svgIcon = MICROSOFT_ICON;
30
- constructor(authService, config, appRef, msalService, msalGuardConfig) {
31
- this.authService = authService;
32
- this.config = config;
33
- this.appRef = appRef;
34
- this.msalService = msalService;
35
- this.msalGuardConfig = msalGuardConfig;
27
+ constructor() {
36
28
  this.options = this.config.getConfig('auth.microsoft');
37
29
  this.msalService.instance = new PublicClientApplication({
38
30
  auth: this.options,
@@ -40,7 +32,7 @@ class AuthMicrosoftComponent {
40
32
  cacheLocation: 'sessionStorage'
41
33
  }
42
34
  });
43
- this.broadcastService = new MsalBroadcastService(this.msalService.instance, this.msalService);
35
+ this.broadcastService = new MsalBroadcastService(this.msalService.instance);
44
36
  if (this.options?.clientId) {
45
37
  this.broadcastService.inProgress$
46
38
  .pipe(filter((status) => status === InteractionStatus.None), takeUntil(this._destroying$))
@@ -87,16 +79,13 @@ class AuthMicrosoftComponent {
87
79
  getConf() {
88
80
  return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];
89
81
  }
90
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthMicrosoftComponent, deps: [{ token: i1.AuthService }, { token: i2.ConfigService }, { token: i0.ApplicationRef }, { token: i3.MsalService }, { token: MSAL_GUARD_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
91
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: AuthMicrosoftComponent, isStandalone: true, selector: "igo-auth-microsoft", outputs: { login: "login" }, ngImport: i0, template: "<button\n class=\"microsoft-login-button\"\n mat-raised-button\n (click)=\"loginMicrosoft()\"\n>\n <igo-icon [icon]=\"svgIcon\"></igo-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{height:40px;width:265px}mat-icon{margin-right:10px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "component", type: IgoIconComponent, selector: "igo-icon", inputs: ["color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
82
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AuthMicrosoftComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
83
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AuthMicrosoftComponent, isStandalone: true, selector: "igo-auth-microsoft", outputs: { login: "login" }, ngImport: i0, template: "<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoft()\"\n>\n <igo-icon [icon]=\"svgIcon\"></igo-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{height:40px;width:265px}mat-icon{margin-right:10px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "component", type: IgoIconComponent, selector: "igo-icon", inputs: ["color", "icon"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
92
84
  }
93
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthMicrosoftComponent, decorators: [{
85
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AuthMicrosoftComponent, decorators: [{
94
86
  type: Component,
95
- args: [{ selector: 'igo-auth-microsoft', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, IgoLanguageModule, IgoIconComponent], template: "<button\n class=\"microsoft-login-button\"\n mat-raised-button\n (click)=\"loginMicrosoft()\"\n>\n <igo-icon [icon]=\"svgIcon\"></igo-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{height:40px;width:265px}mat-icon{margin-right:10px}\n"] }]
96
- }], ctorParameters: () => [{ type: i1.AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }, { type: i3.MsalService }, { type: undefined, decorators: [{
97
- type: Inject,
98
- args: [MSAL_GUARD_CONFIG]
99
- }] }], propDecorators: { login: [{
87
+ args: [{ selector: 'igo-auth-microsoft', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, IgoLanguageModule, IgoIconComponent], template: "<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoft()\"\n>\n <igo-icon [icon]=\"svgIcon\"></igo-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{height:40px;width:265px}mat-icon{margin-right:10px}\n"] }]
88
+ }], ctorParameters: () => [], propDecorators: { login: [{
100
89
  type: Output
101
90
  }] } });
102
91
 
@@ -105,15 +94,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
105
94
  * Licensed under the MIT License.
106
95
  */
107
96
  class MsalServiceb2c {
108
- instance;
109
- location;
97
+ instance = inject(MSAL_INSTANCE);
98
+ location = inject(Location);
110
99
  redirectHash;
111
100
  logger;
112
101
  name = '@azure/msal-angular';
113
102
  version = '2.0.0-beta.2';
114
- constructor(instance, location) {
115
- this.instance = instance;
116
- this.location = location;
103
+ constructor() {
117
104
  const hash = this.location.path(true).split('#').pop();
118
105
  if (hash) {
119
106
  this.redirectHash = `#${hash}`;
@@ -168,30 +155,25 @@ class MsalServiceb2c {
168
155
  this.logger = logger.clone(this.name, this.version);
169
156
  this.instance.setLogger(logger);
170
157
  }
171
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MsalServiceb2c, deps: [{ token: MSAL_INSTANCE }, { token: i1$1.Location }], target: i0.ɵɵFactoryTarget.Injectable });
172
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MsalServiceb2c });
158
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MsalServiceb2c, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
159
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MsalServiceb2c });
173
160
  }
174
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MsalServiceb2c, decorators: [{
161
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MsalServiceb2c, decorators: [{
175
162
  type: Injectable
176
- }], ctorParameters: () => [{ type: undefined, decorators: [{
177
- type: Inject,
178
- args: [MSAL_INSTANCE]
179
- }] }, { type: i1$1.Location }] });
163
+ }], ctorParameters: () => [] });
180
164
 
181
165
  /*
182
166
  * Copyright (c) Microsoft Corporation. All rights reserved.
183
167
  * Licensed under the MIT License.
184
168
  */
185
169
  class MsalBroadcastServiceb2c {
186
- msalInstance;
187
- authService;
170
+ msalInstance = inject(MSAL_INSTANCE);
171
+ authService = inject(MsalServiceb2c);
188
172
  _msalSubject;
189
173
  msalSubject$;
190
174
  _inProgress;
191
175
  inProgress$;
192
- constructor(msalInstance, authService) {
193
- this.msalInstance = msalInstance;
194
- this.authService = authService;
176
+ constructor() {
195
177
  this._msalSubject = new Subject();
196
178
  this.msalSubject$ = this._msalSubject.asObservable();
197
179
  // InProgress as BehaviorSubject so most recent inProgress state will be available upon subscription
@@ -208,33 +190,25 @@ class MsalBroadcastServiceb2c {
208
190
  }
209
191
  });
210
192
  }
211
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MsalBroadcastServiceb2c, deps: [{ token: MSAL_INSTANCE }, { token: MsalServiceb2c }], target: i0.ɵɵFactoryTarget.Injectable });
212
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MsalBroadcastServiceb2c });
193
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MsalBroadcastServiceb2c, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
194
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MsalBroadcastServiceb2c });
213
195
  }
214
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: MsalBroadcastServiceb2c, decorators: [{
196
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MsalBroadcastServiceb2c, decorators: [{
215
197
  type: Injectable
216
- }], ctorParameters: () => [{ type: undefined, decorators: [{
217
- type: Inject,
218
- args: [MSAL_INSTANCE]
219
- }] }, { type: MsalServiceb2c }] });
198
+ }], ctorParameters: () => [] });
220
199
 
221
200
  class AuthMicrosoftb2cComponent {
222
- authService;
223
- config;
224
- appRef;
225
- msalService;
226
- msalGuardConfig;
201
+ authService = inject(AuthService);
202
+ config = inject(ConfigService);
203
+ appRef = inject(ApplicationRef);
204
+ msalService = inject(MsalServiceb2c);
205
+ msalGuardConfig = inject(MSAL_GUARD_CONFIG);
227
206
  options;
228
207
  _destroying$ = new Subject();
229
208
  login = new EventEmitter();
230
209
  broadcastService;
231
210
  svgIcon = MICROSOFT_ICON;
232
- constructor(authService, config, appRef, msalService, msalGuardConfig) {
233
- this.authService = authService;
234
- this.config = config;
235
- this.appRef = appRef;
236
- this.msalService = msalService;
237
- this.msalGuardConfig = msalGuardConfig;
211
+ constructor() {
238
212
  this.options = this.config.getConfig('auth.microsoftb2c') || {};
239
213
  this.msalService.instance = new PublicClientApplication({
240
214
  auth: this.options.browserAuthOptions,
@@ -242,7 +216,7 @@ class AuthMicrosoftb2cComponent {
242
216
  cacheLocation: 'sessionStorage'
243
217
  }
244
218
  });
245
- this.broadcastService = new MsalBroadcastServiceb2c(this.msalService.instance, this.msalService);
219
+ this.broadcastService = new MsalBroadcastServiceb2c();
246
220
  if (this.options.browserAuthOptions.clientId) {
247
221
  this.broadcastService.inProgress$
248
222
  .pipe(filter((status) => status === InteractionStatus.None), takeUntil(this._destroying$))
@@ -285,16 +259,13 @@ class AuthMicrosoftb2cComponent {
285
259
  getConf() {
286
260
  return this.msalGuardConfig.filter((conf) => conf.type === 'b2c')[0];
287
261
  }
288
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthMicrosoftb2cComponent, deps: [{ token: i1.AuthService }, { token: i2.ConfigService }, { token: i0.ApplicationRef }, { token: MsalServiceb2c }, { token: MSAL_GUARD_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
289
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: AuthMicrosoftb2cComponent, isStandalone: true, selector: "igo-auth-microsoftb2c", outputs: { login: "login" }, providers: [MsalServiceb2c], ngImport: i0, template: "<button\n class=\"microsoft-login-button\"\n mat-raised-button\n (click)=\"loginMicrosoftb2c()\"\n>\n <igo-icon [icon]=\"svgIcon\"></igo-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{height:40px;width:265px}mat-icon{margin-right:10px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "component", type: IgoIconComponent, selector: "igo-icon", inputs: ["color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
262
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AuthMicrosoftb2cComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
263
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AuthMicrosoftb2cComponent, isStandalone: true, selector: "igo-auth-microsoftb2c", outputs: { login: "login" }, providers: [MsalServiceb2c], ngImport: i0, template: "<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoftb2c()\"\n>\n <igo-icon [icon]=\"svgIcon\"></igo-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{height:40px;width:265px}mat-icon{margin-right:10px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "component", type: IgoIconComponent, selector: "igo-icon", inputs: ["color", "icon"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
290
264
  }
291
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthMicrosoftb2cComponent, decorators: [{
265
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AuthMicrosoftb2cComponent, decorators: [{
292
266
  type: Component,
293
- args: [{ selector: 'igo-auth-microsoftb2c', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, IgoLanguageModule, IgoIconComponent], providers: [MsalServiceb2c], template: "<button\n class=\"microsoft-login-button\"\n mat-raised-button\n (click)=\"loginMicrosoftb2c()\"\n>\n <igo-icon [icon]=\"svgIcon\"></igo-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{height:40px;width:265px}mat-icon{margin-right:10px}\n"] }]
294
- }], ctorParameters: () => [{ type: i1.AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }, { type: MsalServiceb2c }, { type: undefined, decorators: [{
295
- type: Inject,
296
- args: [MSAL_GUARD_CONFIG]
297
- }] }], propDecorators: { login: [{
267
+ args: [{ selector: 'igo-auth-microsoftb2c', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, IgoLanguageModule, IgoIconComponent], providers: [MsalServiceb2c], template: "<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoftb2c()\"\n>\n <igo-icon [icon]=\"svgIcon\"></igo-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{height:40px;width:265px}mat-icon{margin-right:10px}\n"] }]
268
+ }], ctorParameters: () => [], propDecorators: { login: [{
298
269
  type: Output
299
270
  }] } });
300
271
 
@@ -1 +1 @@
1
- {"version":3,"file":"igo2-auth-microsoft.mjs","sources":["../../../packages/auth/microsoft/src/auth-microsoft/auth-microsoft.component.ts","../../../packages/auth/microsoft/src/auth-microsoft/auth-microsoft.component.html","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-msalServiceb2c.service.ts","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-msalBroadcastServiceb2c.service.ts","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-microsoftb2c.component.ts","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-microsoftb2c.component.html","../../../packages/auth/microsoft/src/auth-microsoft.provider.ts","../../../packages/auth/microsoft/src/igo2-auth-microsoft.ts"],"sourcesContent":["import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Inject,\n Output\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\n\nimport { AuthService } from '@igo2/auth';\nimport { IconSvg, IgoIconComponent, MICROSOFT_ICON } from '@igo2/common/icon';\nimport { ConfigService } from '@igo2/core/config';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport {\n MSAL_GUARD_CONFIG,\n MsalBroadcastService,\n MsalService\n} from '@azure/msal-angular';\nimport {\n AuthenticationResult,\n InteractionRequiredAuthError,\n InteractionStatus,\n PopupRequest,\n PublicClientApplication,\n SilentRequest\n} from '@azure/msal-browser';\nimport { Subject } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport {\n AuthMicrosoftOptions,\n MSPMsalGuardConfiguration\n} from '../shared/auth-microsoft.interface';\n\n@Component({\n selector: 'igo-auth-microsoft',\n templateUrl: './auth-microsoft.component.html',\n styleUrls: ['./auth-microsoft.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatButtonModule, IgoLanguageModule, IgoIconComponent]\n})\nexport class AuthMicrosoftComponent {\n private options?: AuthMicrosoftOptions;\n private readonly _destroying$ = new Subject<void>();\n @Output() login: EventEmitter<boolean> = new EventEmitter<boolean>();\n private broadcastService: MsalBroadcastService;\n\n svgIcon: IconSvg = MICROSOFT_ICON;\n\n constructor(\n private authService: AuthService,\n private config: ConfigService,\n private appRef: ApplicationRef,\n private msalService: MsalService,\n @Inject(MSAL_GUARD_CONFIG)\n private msalGuardConfig: MSPMsalGuardConfiguration[]\n ) {\n this.options = this.config.getConfig('auth.microsoft');\n\n this.msalService.instance = new PublicClientApplication({\n auth: this.options,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n this.broadcastService = new MsalBroadcastService(\n this.msalService.instance,\n this.msalService\n );\n\n if (this.options?.clientId) {\n this.broadcastService.inProgress$\n .pipe(\n filter(\n (status: InteractionStatus) => status === InteractionStatus.None\n ),\n takeUntil(this._destroying$)\n )\n .subscribe(() => {\n this.checkAccount();\n });\n } else {\n console.warn('Microsoft authentification needs \"clientId\" option');\n }\n }\n\n public loginMicrosoft() {\n this.msalService\n .loginPopup({ ...this.getConf().authRequest } as PopupRequest)\n .subscribe((response: AuthenticationResult) => {\n this.msalService.instance.setActiveAccount(response.account);\n this.checkAccount();\n });\n }\n\n private checkAccount() {\n this.msalService.instance\n .acquireTokenSilent(this.getConf().authRequest as SilentRequest)\n .then((response: AuthenticationResult) => {\n const tokenAccess = response.accessToken;\n const tokenId = response.idToken;\n this.authService\n .loginWithToken(tokenAccess, 'microsoft', { tokenId })\n .subscribe(() => {\n this.appRef.tick();\n this.login.emit(true);\n });\n })\n .catch(async (error) => {\n if (error instanceof InteractionRequiredAuthError) {\n // fallback to interaction when silent call fails\n return this.msalService.acquireTokenPopup(\n this.getConf().authRequest as SilentRequest\n );\n }\n console.log(error);\n })\n .catch(() => {\n console.log('Silent token fails');\n });\n }\n\n private getConf(): MSPMsalGuardConfiguration {\n return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];\n }\n}\n","<button\n class=\"microsoft-login-button\"\n mat-raised-button\n (click)=\"loginMicrosoft()\"\n>\n <igo-icon [icon]=\"svgIcon\"></igo-icon>\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { Location } from '@angular/common';\nimport { Inject, Injectable } from '@angular/core';\n\nimport { MSAL_INSTANCE } from '@azure/msal-angular';\nimport { IMsalService } from '@azure/msal-angular';\nimport {\n AuthenticationResult,\n EndSessionPopupRequest,\n EndSessionRequest,\n IPublicClientApplication,\n Logger,\n PopupRequest,\n RedirectRequest,\n SilentRequest,\n SsoSilentRequest,\n WrapperSKU\n} from '@azure/msal-browser';\nimport { Observable, from } from 'rxjs';\n\n@Injectable()\nexport class MsalServiceb2c implements IMsalService {\n private redirectHash: string;\n private logger: Logger;\n private name = '@azure/msal-angular';\n private version = '2.0.0-beta.2';\n constructor(\n @Inject(MSAL_INSTANCE) public instance: IPublicClientApplication,\n private location: Location\n ) {\n const hash = this.location.path(true).split('#').pop();\n if (hash) {\n this.redirectHash = `#${hash}`;\n }\n this.instance.initializeWrapperLibrary(WrapperSKU.Angular, this.version);\n }\n\n initialize(): Observable<void> {\n return from(this.instance.initialize());\n }\n\n acquireTokenPopup(request: PopupRequest): Observable<AuthenticationResult> {\n return from(this.instance.acquireTokenPopup(request));\n }\n acquireTokenRedirect(request: RedirectRequest): Observable<void> {\n return from(this.instance.acquireTokenRedirect(request));\n }\n acquireTokenSilent(\n silentRequest: SilentRequest\n ): Observable<AuthenticationResult> {\n return from(this.instance.acquireTokenSilent(silentRequest));\n }\n handleRedirectObservable(hash?: string): Observable<AuthenticationResult> {\n return from(this.instance.handleRedirectPromise(hash || this.redirectHash));\n }\n loginPopup(request?: PopupRequest): Observable<AuthenticationResult> {\n return from(this.instance.loginPopup(request));\n }\n loginRedirect(request?: RedirectRequest): Observable<void> {\n return from(this.instance.loginRedirect(request));\n }\n logout(logoutRequest?: EndSessionRequest): Observable<void> {\n return from(this.instance.logout(logoutRequest));\n }\n logoutRedirect(logoutRequest?: EndSessionRequest): Observable<void> {\n return from(this.instance.logoutRedirect(logoutRequest));\n }\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Observable<void> {\n return from(this.instance.logoutPopup(logoutRequest));\n }\n ssoSilent(request: SsoSilentRequest): Observable<AuthenticationResult> {\n return from(this.instance.ssoSilent(request));\n }\n /**\n * Gets logger for msal-angular.\n * If no logger set, returns logger instance created with same options as msal-browser\n */\n getLogger(): Logger {\n if (!this.logger) {\n this.logger = this.instance.getLogger().clone(this.name, this.version);\n }\n return this.logger;\n }\n // Create a logger instance for msal-angular with the same options as msal-browser\n setLogger(logger: Logger): void {\n this.logger = logger.clone(this.name, this.version);\n this.instance.setLogger(logger);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { Inject, Injectable } from '@angular/core';\n\nimport { MSAL_INSTANCE } from '@azure/msal-angular';\nimport {\n EventMessage,\n EventMessageUtils,\n IPublicClientApplication,\n InteractionStatus\n} from '@azure/msal-browser';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\n\nimport { MsalServiceb2c } from './auth-msalServiceb2c.service';\n\n@Injectable()\nexport class MsalBroadcastServiceb2c {\n private _msalSubject: Subject<EventMessage>;\n public msalSubject$: Observable<EventMessage>;\n private _inProgress: BehaviorSubject<InteractionStatus>;\n public inProgress$: Observable<InteractionStatus>;\n\n constructor(\n @Inject(MSAL_INSTANCE) private msalInstance: IPublicClientApplication,\n private authService: MsalServiceb2c\n ) {\n this._msalSubject = new Subject<EventMessage>();\n this.msalSubject$ = this._msalSubject.asObservable();\n\n // InProgress as BehaviorSubject so most recent inProgress state will be available upon subscription\n this._inProgress = new BehaviorSubject<InteractionStatus>(\n InteractionStatus.Startup\n );\n this.inProgress$ = this._inProgress.asObservable();\n\n this.msalInstance.addEventCallback((message: EventMessage) => {\n this._msalSubject.next(message);\n const status = EventMessageUtils.getInteractionStatusFromEvent(message);\n if (status !== null) {\n this.authService\n .getLogger()\n .verbose(\n `BroadcastService - ${message.eventType} results in setting inProgress to ${status}`\n );\n this._inProgress.next(status);\n }\n });\n }\n}\n","import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Inject,\n Output\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\n\nimport { AuthService } from '@igo2/auth';\nimport { IconSvg, IgoIconComponent, MICROSOFT_ICON } from '@igo2/common/icon';\nimport { ConfigService } from '@igo2/core/config';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { MSAL_GUARD_CONFIG } from '@azure/msal-angular';\nimport {\n AuthenticationResult,\n InteractionRequiredAuthError,\n InteractionStatus,\n PopupRequest,\n PublicClientApplication,\n SilentRequest\n} from '@azure/msal-browser';\nimport { Subject } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport {\n AuthMicrosoftb2cOptions,\n MSPMsalGuardConfiguration\n} from '../shared/auth-microsoft.interface';\nimport { MsalBroadcastServiceb2c } from './auth-msalBroadcastServiceb2c.service';\nimport { MsalServiceb2c } from './auth-msalServiceb2c.service';\n\n@Component({\n selector: 'igo-auth-microsoftb2c',\n templateUrl: './auth-microsoftb2c.component.html',\n styleUrls: ['./auth-microsoftb2c.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatButtonModule, IgoLanguageModule, IgoIconComponent],\n providers: [MsalServiceb2c]\n})\nexport class AuthMicrosoftb2cComponent {\n private options: AuthMicrosoftb2cOptions;\n private readonly _destroying$ = new Subject<void>();\n @Output() login: EventEmitter<boolean> = new EventEmitter<boolean>();\n private broadcastService: MsalBroadcastServiceb2c;\n\n svgIcon: IconSvg = MICROSOFT_ICON;\n\n constructor(\n private authService: AuthService,\n private config: ConfigService,\n private appRef: ApplicationRef,\n private msalService: MsalServiceb2c,\n @Inject(MSAL_GUARD_CONFIG)\n private msalGuardConfig: MSPMsalGuardConfiguration[]\n ) {\n this.options = this.config.getConfig('auth.microsoftb2c') || {};\n\n this.msalService.instance = new PublicClientApplication({\n auth: this.options.browserAuthOptions,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n this.broadcastService = new MsalBroadcastServiceb2c(\n this.msalService.instance,\n this.msalService\n );\n\n if (this.options.browserAuthOptions.clientId) {\n this.broadcastService.inProgress$\n .pipe(\n filter(\n (status: InteractionStatus) => status === InteractionStatus.None\n ),\n takeUntil(this._destroying$)\n )\n .subscribe(() => {\n this.checkAccount();\n });\n } else {\n console.warn('Microsoft authentification needs \"clientId\" option');\n }\n }\n\n public loginMicrosoftb2c() {\n this.msalService\n .loginPopup({ ...this.getConf().authRequest } as PopupRequest)\n .subscribe((response: AuthenticationResult) => {\n this.msalService.instance.setActiveAccount(response.account);\n this.checkAccount();\n });\n }\n\n private checkAccount() {\n this.msalService.instance\n .acquireTokenSilent(this.getConf().authRequest as SilentRequest)\n .then((response: AuthenticationResult) => {\n const token = response.idToken;\n this.authService.loginWithToken(token, 'microsoftb2c').subscribe(() => {\n this.appRef.tick();\n this.login.emit(true);\n });\n })\n .catch(async (error) => {\n if (error instanceof InteractionRequiredAuthError) {\n // fallback to interaction when silent call fails\n return this.msalService.acquireTokenPopup(\n this.getConf().authRequest as SilentRequest\n );\n }\n })\n .catch(() => {\n console.log('Silent token fails');\n });\n }\n\n private getConf(): MSPMsalGuardConfiguration {\n return this.msalGuardConfig.filter((conf) => conf.type === 'b2c')[0];\n }\n}\n","<button\n class=\"microsoft-login-button\"\n mat-raised-button\n (click)=\"loginMicrosoftb2c()\"\n>\n <igo-icon [icon]=\"svgIcon\"></igo-icon>\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n","import { AuthFeature, AuthFeatureKind } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\n\nimport {\n MSAL_GUARD_CONFIG,\n MSAL_INSTANCE,\n MsalService\n} from '@azure/msal-angular';\nimport { InteractionType, PublicClientApplication } from '@azure/msal-browser';\nimport { BrowserAuthOptions } from '@azure/msal-browser';\n\nimport { AuthMicrosoftComponent } from './auth-microsoft/auth-microsoft.component';\nimport { AuthMicrosoftb2cComponent } from './auth-microsoftb2c/auth-microsoftb2c.component';\nimport { MsalServiceb2c } from './auth-microsoftb2c/auth-msalServiceb2c.service';\nimport {\n AuthMicrosoftOptions,\n MSPMsalGuardConfiguration\n} from './shared/auth-microsoft.interface';\n\nexport const AUTH_MICROSOFT_DIRECTIVES = [\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent\n] as const;\n\nexport function MSALConfigFactory(\n config: ConfigService\n): PublicClientApplication {\n const msConf = config.getConfig('auth.microsoft') as AuthMicrosoftOptions;\n if (!msConf) {\n return;\n }\n\n msConf.redirectUri = msConf?.redirectUri || window.location.href;\n msConf.authority =\n msConf?.authority || 'https://login.microsoftonline.com/organizations';\n\n const myMsalObj = new PublicClientApplication({\n auth: msConf,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n return myMsalObj;\n}\n\nexport function MSALConfigFactoryb2c(\n config: ConfigService\n): PublicClientApplication {\n const msConf = config.getConfig(\n 'auth.microsoftb2c.browserAuthOptions'\n ) as BrowserAuthOptions;\n if (!msConf) {\n return;\n }\n msConf.redirectUri = msConf?.redirectUri || window.location.href;\n msConf.authority =\n msConf?.authority || 'https://login.microsoftonline.com/organizations';\n\n const myMsalObj = new PublicClientApplication({\n auth: msConf,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n return myMsalObj;\n}\n\nexport function MSALAngularConfigFactory(): MSPMsalGuardConfiguration {\n return {\n interactionType: InteractionType.Popup,\n authRequest: {\n scopes: ['user.read'],\n loginHint: 'todo'\n },\n type: 'add'\n };\n}\n\nexport function MSALAngularConfigFactoryb2c(\n config: ConfigService\n): MSPMsalGuardConfiguration {\n const msConf = config.getConfig(\n 'auth.microsoftb2c.browserAuthOptions'\n ) as BrowserAuthOptions;\n\n return {\n interactionType: InteractionType.Popup,\n authRequest: {\n scopes: [msConf?.clientId]\n },\n type: 'b2c'\n };\n}\n\nexport function withMicrosoftSupport(\n type?: string\n): AuthFeature<AuthFeatureKind.Microsoft> {\n if (type === 'b2c') {\n return {\n kind: AuthFeatureKind.Microsoft,\n providers: [\n {\n provide: MSAL_INSTANCE,\n useFactory: MSALConfigFactoryb2c,\n deps: [ConfigService]\n },\n {\n provide: MSAL_GUARD_CONFIG,\n useFactory: MSALAngularConfigFactoryb2c,\n deps: [ConfigService],\n multi: true\n },\n MsalServiceb2c\n ]\n };\n } else {\n return {\n kind: AuthFeatureKind.Microsoft,\n providers: [\n {\n provide: MSAL_INSTANCE,\n useFactory: MSALConfigFactory,\n deps: [ConfigService]\n },\n {\n provide: MSAL_GUARD_CONFIG,\n useFactory: MSALAngularConfigFactory,\n deps: [ConfigService],\n multi: true\n },\n MsalService\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i1.MsalServiceb2c"],"mappings":";;;;;;;;;;;;;;;;;;MA2Ca,sBAAsB,CAAA;AASvB,IAAA,WAAA;AACA,IAAA,MAAA;AACA,IAAA,MAAA;AACA,IAAA,WAAA;AAEA,IAAA,eAAA;AAbF,IAAA,OAAO;AACE,IAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;AACzC,IAAA,KAAK,GAA0B,IAAI,YAAY,EAAW;AAC5D,IAAA,gBAAgB;IAExB,OAAO,GAAY,cAAc;IAEjC,WACU,CAAA,WAAwB,EACxB,MAAqB,EACrB,MAAsB,EACtB,WAAwB,EAExB,eAA4C,EAAA;QAL5C,IAAW,CAAA,WAAA,GAAX,WAAW;QACX,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAW,CAAA,WAAA,GAAX,WAAW;QAEX,IAAe,CAAA,eAAA,GAAf,eAAe;QAEvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC;AAEtD,QAAA,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,uBAAuB,CAAC;YACtD,IAAI,EAAE,IAAI,CAAC,OAAO;AAClB,YAAA,KAAK,EAAE;AACL,gBAAA,aAAa,EAAE;AAChB;AACF,SAAA,CAAC;AAEF,QAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,oBAAoB,CAC9C,IAAI,CAAC,WAAW,CAAC,QAAQ,EACzB,IAAI,CAAC,WAAW,CACjB;AAED,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE;YAC1B,IAAI,CAAC,gBAAgB,CAAC;iBACnB,IAAI,CACH,MAAM,CACJ,CAAC,MAAyB,KAAK,MAAM,KAAK,iB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AAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,aAAa;AACtB,oBAAA,UAAU,EAAE,oBAAoB;oBAChC,IAAI,EAAE,CAAC,aAAa;AACrB,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE,iBAAiB;AAC1B,oBAAA,UAAU,EAAE,2BAA2B;oBACvC,IAAI,EAAE,CAAC,aAAa,CAAC;AACrB,oBAAA,KAAK,EAAE;AACR,iBAAA;gBACD;AACD;SACF;;SACI;QACL,OAAO;YACL,IAAI,EAAE,eAAe,CAAC,SAAS;AAC/B,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,aAAa;AACtB,oBAAA,UAAU,EAAE,iBAAiB;oBAC7B,IAAI,EAAE,CAAC,aAAa;AACrB,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE,iBAAiB;AAC1B,oBAAA,UAAU,EAAE,wBAAwB;oBACpC,IAAI,EAAE,CAAC,aAAa,CAAC;AACrB,oBAAA,KAAK,EAAE;AACR,iBAAA;gBACD;AACD;SACF;;AAEL;;ACxIA;;AAEG;;;;"}
1
+ {"version":3,"file":"igo2-auth-microsoft.mjs","sources":["../../../packages/auth/microsoft/src/auth-microsoft/auth-microsoft.component.ts","../../../packages/auth/microsoft/src/auth-microsoft/auth-microsoft.component.html","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-msalServiceb2c.service.ts","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-msalBroadcastServiceb2c.service.ts","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-microsoftb2c.component.ts","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-microsoftb2c.component.html","../../../packages/auth/microsoft/src/auth-microsoft.provider.ts","../../../packages/auth/microsoft/src/igo2-auth-microsoft.ts"],"sourcesContent":["import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Output,\n inject\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\n\nimport { AuthService } from '@igo2/auth';\nimport { IconSvg, IgoIconComponent, MICROSOFT_ICON } from '@igo2/common/icon';\nimport { ConfigService } from '@igo2/core/config';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport {\n MSAL_GUARD_CONFIG,\n MsalBroadcastService,\n MsalService\n} from '@azure/msal-angular';\nimport {\n AuthenticationResult,\n InteractionRequiredAuthError,\n InteractionStatus,\n PopupRequest,\n PublicClientApplication,\n SilentRequest\n} from '@azure/msal-browser';\nimport { Subject } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport {\n AuthMicrosoftOptions,\n MSPMsalGuardConfiguration\n} from '../shared/auth-microsoft.interface';\n\n@Component({\n selector: 'igo-auth-microsoft',\n templateUrl: './auth-microsoft.component.html',\n styleUrls: ['./auth-microsoft.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatButtonModule, IgoLanguageModule, IgoIconComponent]\n})\nexport class AuthMicrosoftComponent {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private appRef = inject(ApplicationRef);\n private msalService = inject(MsalService);\n private msalGuardConfig =\n inject<MSPMsalGuardConfiguration[]>(MSAL_GUARD_CONFIG);\n\n private options?: AuthMicrosoftOptions;\n private readonly _destroying$ = new Subject<void>();\n @Output() login: EventEmitter<boolean> = new EventEmitter<boolean>();\n private broadcastService: MsalBroadcastService;\n\n svgIcon: IconSvg = MICROSOFT_ICON;\n\n constructor() {\n this.options = this.config.getConfig('auth.microsoft');\n\n this.msalService.instance = new PublicClientApplication({\n auth: this.options,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n this.broadcastService = new MsalBroadcastService(this.msalService.instance);\n\n if (this.options?.clientId) {\n this.broadcastService.inProgress$\n .pipe(\n filter(\n (status: InteractionStatus) => status === InteractionStatus.None\n ),\n takeUntil(this._destroying$)\n )\n .subscribe(() => {\n this.checkAccount();\n });\n } else {\n console.warn('Microsoft authentification needs \"clientId\" option');\n }\n }\n\n public loginMicrosoft() {\n this.msalService\n .loginPopup({ ...this.getConf().authRequest } as PopupRequest)\n .subscribe((response: AuthenticationResult) => {\n this.msalService.instance.setActiveAccount(response.account);\n this.checkAccount();\n });\n }\n\n private checkAccount() {\n this.msalService.instance\n .acquireTokenSilent(this.getConf().authRequest as SilentRequest)\n .then((response: AuthenticationResult) => {\n const tokenAccess = response.accessToken;\n const tokenId = response.idToken;\n this.authService\n .loginWithToken(tokenAccess, 'microsoft', { tokenId })\n .subscribe(() => {\n this.appRef.tick();\n this.login.emit(true);\n });\n })\n .catch(async (error) => {\n if (error instanceof InteractionRequiredAuthError) {\n // fallback to interaction when silent call fails\n return this.msalService.acquireTokenPopup(\n this.getConf().authRequest as SilentRequest\n );\n }\n console.log(error);\n })\n .catch(() => {\n console.log('Silent token fails');\n });\n }\n\n private getConf(): MSPMsalGuardConfiguration {\n return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];\n }\n}\n","<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoft()\"\n>\n <igo-icon [icon]=\"svgIcon\"></igo-icon>\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { Location } from '@angular/common';\nimport { Injectable, inject } from '@angular/core';\n\nimport { MSAL_INSTANCE } from '@azure/msal-angular';\nimport { IMsalService } from '@azure/msal-angular';\nimport {\n AuthenticationResult,\n EndSessionPopupRequest,\n EndSessionRequest,\n IPublicClientApplication,\n Logger,\n PopupRequest,\n RedirectRequest,\n SilentRequest,\n SsoSilentRequest,\n WrapperSKU\n} from '@azure/msal-browser';\nimport { Observable, from } from 'rxjs';\n\n@Injectable()\nexport class MsalServiceb2c implements IMsalService {\n instance = inject<IPublicClientApplication>(MSAL_INSTANCE);\n private location = inject(Location);\n\n private redirectHash: string;\n private logger: Logger;\n private name = '@azure/msal-angular';\n private version = '2.0.0-beta.2';\n constructor() {\n const hash = this.location.path(true).split('#').pop();\n if (hash) {\n this.redirectHash = `#${hash}`;\n }\n this.instance.initializeWrapperLibrary(WrapperSKU.Angular, this.version);\n }\n\n initialize(): Observable<void> {\n return from(this.instance.initialize());\n }\n\n acquireTokenPopup(request: PopupRequest): Observable<AuthenticationResult> {\n return from(this.instance.acquireTokenPopup(request));\n }\n acquireTokenRedirect(request: RedirectRequest): Observable<void> {\n return from(this.instance.acquireTokenRedirect(request));\n }\n acquireTokenSilent(\n silentRequest: SilentRequest\n ): Observable<AuthenticationResult> {\n return from(this.instance.acquireTokenSilent(silentRequest));\n }\n handleRedirectObservable(hash?: string): Observable<AuthenticationResult> {\n return from(this.instance.handleRedirectPromise(hash || this.redirectHash));\n }\n loginPopup(request?: PopupRequest): Observable<AuthenticationResult> {\n return from(this.instance.loginPopup(request));\n }\n loginRedirect(request?: RedirectRequest): Observable<void> {\n return from(this.instance.loginRedirect(request));\n }\n logout(logoutRequest?: EndSessionRequest): Observable<void> {\n return from(this.instance.logout(logoutRequest));\n }\n logoutRedirect(logoutRequest?: EndSessionRequest): Observable<void> {\n return from(this.instance.logoutRedirect(logoutRequest));\n }\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Observable<void> {\n return from(this.instance.logoutPopup(logoutRequest));\n }\n ssoSilent(request: SsoSilentRequest): Observable<AuthenticationResult> {\n return from(this.instance.ssoSilent(request));\n }\n /**\n * Gets logger for msal-angular.\n * If no logger set, returns logger instance created with same options as msal-browser\n */\n getLogger(): Logger {\n if (!this.logger) {\n this.logger = this.instance.getLogger().clone(this.name, this.version);\n }\n return this.logger;\n }\n // Create a logger instance for msal-angular with the same options as msal-browser\n setLogger(logger: Logger): void {\n this.logger = logger.clone(this.name, this.version);\n this.instance.setLogger(logger);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { Injectable, inject } from '@angular/core';\n\nimport { MSAL_INSTANCE } from '@azure/msal-angular';\nimport {\n EventMessage,\n EventMessageUtils,\n IPublicClientApplication,\n InteractionStatus\n} from '@azure/msal-browser';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\n\nimport { MsalServiceb2c } from './auth-msalServiceb2c.service';\n\n@Injectable()\nexport class MsalBroadcastServiceb2c {\n private msalInstance = inject<IPublicClientApplication>(MSAL_INSTANCE);\n private authService = inject(MsalServiceb2c);\n\n private _msalSubject: Subject<EventMessage>;\n public msalSubject$: Observable<EventMessage>;\n private _inProgress: BehaviorSubject<InteractionStatus>;\n public inProgress$: Observable<InteractionStatus>;\n\n constructor() {\n this._msalSubject = new Subject<EventMessage>();\n this.msalSubject$ = this._msalSubject.asObservable();\n\n // InProgress as BehaviorSubject so most recent inProgress state will be available upon subscription\n this._inProgress = new BehaviorSubject<InteractionStatus>(\n InteractionStatus.Startup\n );\n this.inProgress$ = this._inProgress.asObservable();\n\n this.msalInstance.addEventCallback((message: EventMessage) => {\n this._msalSubject.next(message);\n const status = EventMessageUtils.getInteractionStatusFromEvent(message);\n if (status !== null) {\n this.authService\n .getLogger()\n .verbose(\n `BroadcastService - ${message.eventType} results in setting inProgress to ${status}`\n );\n this._inProgress.next(status);\n }\n });\n }\n}\n","import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Output,\n inject\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\n\nimport { AuthService } from '@igo2/auth';\nimport { IconSvg, IgoIconComponent, MICROSOFT_ICON } from '@igo2/common/icon';\nimport { ConfigService } from '@igo2/core/config';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { MSAL_GUARD_CONFIG } from '@azure/msal-angular';\nimport {\n AuthenticationResult,\n InteractionRequiredAuthError,\n InteractionStatus,\n PopupRequest,\n PublicClientApplication,\n SilentRequest\n} from '@azure/msal-browser';\nimport { Subject } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport {\n AuthMicrosoftb2cOptions,\n MSPMsalGuardConfiguration\n} from '../shared/auth-microsoft.interface';\nimport { MsalBroadcastServiceb2c } from './auth-msalBroadcastServiceb2c.service';\nimport { MsalServiceb2c } from './auth-msalServiceb2c.service';\n\n@Component({\n selector: 'igo-auth-microsoftb2c',\n templateUrl: './auth-microsoftb2c.component.html',\n styleUrls: ['./auth-microsoftb2c.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatButtonModule, IgoLanguageModule, IgoIconComponent],\n providers: [MsalServiceb2c]\n})\nexport class AuthMicrosoftb2cComponent {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private appRef = inject(ApplicationRef);\n private msalService = inject(MsalServiceb2c);\n private msalGuardConfig =\n inject<MSPMsalGuardConfiguration[]>(MSAL_GUARD_CONFIG);\n\n private options: AuthMicrosoftb2cOptions;\n private readonly _destroying$ = new Subject<void>();\n @Output() login: EventEmitter<boolean> = new EventEmitter<boolean>();\n private broadcastService: MsalBroadcastServiceb2c;\n\n svgIcon: IconSvg = MICROSOFT_ICON;\n\n constructor() {\n this.options = this.config.getConfig('auth.microsoftb2c') || {};\n\n this.msalService.instance = new PublicClientApplication({\n auth: this.options.browserAuthOptions,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n this.broadcastService = new MsalBroadcastServiceb2c();\n\n if (this.options.browserAuthOptions.clientId) {\n this.broadcastService.inProgress$\n .pipe(\n filter(\n (status: InteractionStatus) => status === InteractionStatus.None\n ),\n takeUntil(this._destroying$)\n )\n .subscribe(() => {\n this.checkAccount();\n });\n } else {\n console.warn('Microsoft authentification needs \"clientId\" option');\n }\n }\n\n public loginMicrosoftb2c() {\n this.msalService\n .loginPopup({ ...this.getConf().authRequest } as PopupRequest)\n .subscribe((response: AuthenticationResult) => {\n this.msalService.instance.setActiveAccount(response.account);\n this.checkAccount();\n });\n }\n\n private checkAccount() {\n this.msalService.instance\n .acquireTokenSilent(this.getConf().authRequest as SilentRequest)\n .then((response: AuthenticationResult) => {\n const token = response.idToken;\n this.authService.loginWithToken(token, 'microsoftb2c').subscribe(() => {\n this.appRef.tick();\n this.login.emit(true);\n });\n })\n .catch(async (error) => {\n if (error instanceof InteractionRequiredAuthError) {\n // fallback to interaction when silent call fails\n return this.msalService.acquireTokenPopup(\n this.getConf().authRequest as SilentRequest\n );\n }\n })\n .catch(() => {\n console.log('Silent token fails');\n });\n }\n\n private getConf(): MSPMsalGuardConfiguration {\n return this.msalGuardConfig.filter((conf) => conf.type === 'b2c')[0];\n }\n}\n","<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoftb2c()\"\n>\n <igo-icon [icon]=\"svgIcon\"></igo-icon>\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n","import { AuthFeature, AuthFeatureKind } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\n\nimport {\n MSAL_GUARD_CONFIG,\n MSAL_INSTANCE,\n MsalService\n} from '@azure/msal-angular';\nimport { InteractionType, PublicClientApplication } from '@azure/msal-browser';\nimport { BrowserAuthOptions } from '@azure/msal-browser';\n\nimport { AuthMicrosoftComponent } from './auth-microsoft/auth-microsoft.component';\nimport { AuthMicrosoftb2cComponent } from './auth-microsoftb2c/auth-microsoftb2c.component';\nimport { MsalServiceb2c } from './auth-microsoftb2c/auth-msalServiceb2c.service';\nimport {\n AuthMicrosoftOptions,\n MSPMsalGuardConfiguration\n} from './shared/auth-microsoft.interface';\n\nexport const AUTH_MICROSOFT_DIRECTIVES = [\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent\n] as const;\n\nexport function MSALConfigFactory(\n config: ConfigService\n): PublicClientApplication {\n const msConf = config.getConfig('auth.microsoft') as AuthMicrosoftOptions;\n if (!msConf) {\n return;\n }\n\n msConf.redirectUri = msConf?.redirectUri || window.location.href;\n msConf.authority =\n msConf?.authority || 'https://login.microsoftonline.com/organizations';\n\n const myMsalObj = new PublicClientApplication({\n auth: msConf,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n return myMsalObj;\n}\n\nexport function MSALConfigFactoryb2c(\n config: ConfigService\n): PublicClientApplication {\n const msConf = config.getConfig(\n 'auth.microsoftb2c.browserAuthOptions'\n ) as BrowserAuthOptions;\n if (!msConf) {\n return;\n }\n msConf.redirectUri = msConf?.redirectUri || window.location.href;\n msConf.authority =\n msConf?.authority || 'https://login.microsoftonline.com/organizations';\n\n const myMsalObj = new PublicClientApplication({\n auth: msConf,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n return myMsalObj;\n}\n\nexport function MSALAngularConfigFactory(): MSPMsalGuardConfiguration {\n return {\n interactionType: InteractionType.Popup,\n authRequest: {\n scopes: ['user.read'],\n loginHint: 'todo'\n },\n type: 'add'\n };\n}\n\nexport function MSALAngularConfigFactoryb2c(\n config: ConfigService\n): MSPMsalGuardConfiguration {\n const msConf = config.getConfig(\n 'auth.microsoftb2c.browserAuthOptions'\n ) as BrowserAuthOptions;\n\n return {\n interactionType: InteractionType.Popup,\n authRequest: {\n scopes: [msConf?.clientId]\n },\n type: 'b2c'\n };\n}\n\nexport function withMicrosoftSupport(\n type?: string\n): AuthFeature<AuthFeatureKind.Microsoft> {\n if (type === 'b2c') {\n return {\n kind: AuthFeatureKind.Microsoft,\n providers: [\n {\n provide: MSAL_INSTANCE,\n useFactory: MSALConfigFactoryb2c,\n deps: [ConfigService]\n },\n {\n provide: MSAL_GUARD_CONFIG,\n useFactory: MSALAngularConfigFactoryb2c,\n deps: [ConfigService],\n multi: true\n },\n MsalServiceb2c\n ]\n };\n } else {\n return {\n kind: AuthFeatureKind.Microsoft,\n providers: [\n {\n provide: MSAL_INSTANCE,\n useFactory: MSALConfigFactory,\n deps: [ConfigService]\n },\n {\n provide: MSAL_GUARD_CONFIG,\n useFactory: MSALAngularConfigFactory,\n deps: [ConfigService],\n multi: true\n },\n MsalService\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MA2Ca,sBAAsB,CAAA;AACzB,IAAA,WAAW,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AC7B,sCAAsC,CACjB;IAEvB,OAAO;QACL,eAAe,EAAE,eAAe,CAAC,KAAK;AACtC,QAAA,WAAW,EAAE;AACX,YAAA,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ;AAC1B,SAAA;AACD,QAAA,IAAI,EAAE;KACP;AACH;AAEM,SAAU,oBAAoB,CAClC,IAAa,EAAA;AAEb,IAAA,IAAI,IAAI,KAAK,KAAK,EAAE;QAClB,OAAO;YACL,IAAI,EAAE,eAAe,CAAC,SAAS;AAC/B,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,aAAa;AACtB,oBAAA,UAAU,EAAE,oBAAoB;oBAChC,IAAI,EAAE,CAAC,aAAa;AACrB,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE,iBAAiB;AAC1B,oBAAA,UAAU,EAAE,2BAA2B;oBACvC,IAAI,EAAE,CAAC,aAAa,CAAC;AACrB,oBAAA,KAAK,EAAE;AACR,iBAAA;gBACD;AACD;SACF;IACH;SAAO;QACL,OAAO;YACL,IAAI,EAAE,eAAe,CAAC,SAAS;AAC/B,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,aAAa;AACtB,oBAAA,UAAU,EAAE,iBAAiB;oBAC7B,IAAI,EAAE,CAAC,aAAa;AACrB,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE,iBAAiB;AAC1B,oBAAA,UAAU,EAAE,wBAAwB;oBACpC,IAAI,EAAE,CAAC,aAAa,CAAC;AACrB,oBAAA,KAAK,EAAE;AACR,iBAAA;gBACD;AACD;SACF;IACH;AACF;;ACxIA;;AAEG;;;;"}
@@ -1,21 +1,17 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Optional, Inject, Injectable, Injector, provideAppInitializer, inject } from '@angular/core';
3
- import * as i1 from '@igo2/core/config';
2
+ import { inject, Injector, Injectable, provideAppInitializer } from '@angular/core';
4
3
  import { ConfigService } from '@igo2/core/config';
5
- import { identifySentryUser, MONITORING_OPTIONS } from '@igo2/core/monitoring';
4
+ import { MONITORING_OPTIONS, identifySentryUser } from '@igo2/core/monitoring';
6
5
  import { AuthService } from '@igo2/auth';
7
6
  import { first, switchMap } from 'rxjs';
8
7
 
9
8
  class AuthMonitoringService {
10
- configService;
11
- monitoringOptions;
12
- injector;
9
+ configService = inject(ConfigService);
10
+ monitoringOptions = inject(MONITORING_OPTIONS, { optional: true });
11
+ injector = inject(Injector);
13
12
  // The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER
14
13
  authService;
15
- constructor(configService, monitoringOptions, injector) {
16
- this.configService = configService;
17
- this.monitoringOptions = monitoringOptions;
18
- this.injector = injector;
14
+ constructor() {
19
15
  if (!this.monitoringOptions?.identifyUser) {
20
16
  return;
21
17
  }
@@ -38,20 +34,15 @@ class AuthMonitoringService {
38
34
  break;
39
35
  }
40
36
  }
41
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthMonitoringService, deps: [{ token: i1.ConfigService }, { token: MONITORING_OPTIONS, optional: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
42
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
37
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AuthMonitoringService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
38
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
43
39
  }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthMonitoringService, decorators: [{
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AuthMonitoringService, decorators: [{
45
41
  type: Injectable,
46
42
  args: [{
47
43
  providedIn: 'root'
48
44
  }]
49
- }], ctorParameters: () => [{ type: i1.ConfigService }, { type: undefined, decorators: [{
50
- type: Optional
51
- }, {
52
- type: Inject,
53
- args: [MONITORING_OPTIONS]
54
- }] }, { type: i0.Injector }] });
45
+ }], ctorParameters: () => [] });
55
46
 
56
47
  function provideAuthUserMonitoring(options) {
57
48
  if (!options) {
@@ -1 +1 @@
1
- {"version":3,"file":"igo2-auth-monitoring.mjs","sources":["../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.service.ts","../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.provider.ts","../../../packages/auth/monitoring/src/igo2-auth-monitoring.ts"],"sourcesContent":["import { Inject, Injectable, Injector, Optional } from '@angular/core';\n\nimport { AuthService, User } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\nimport {\n AnyMonitoringOptions,\n MONITORING_OPTIONS,\n identifySentryUser\n} from '@igo2/core/monitoring';\n\nimport { first, switchMap } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthMonitoringService {\n // The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER\n authService?: AuthService;\n\n constructor(\n private configService: ConfigService,\n @Optional()\n @Inject(MONITORING_OPTIONS)\n private monitoringOptions: AnyMonitoringOptions | null,\n private injector: Injector\n ) {\n if (!this.monitoringOptions?.identifyUser) {\n return;\n }\n\n this.configService.isLoaded$\n .pipe(\n first((isLoaded) => isLoaded),\n switchMap(() => {\n this.authService = this.injector.get(AuthService);\n return this.authService?.authenticate$;\n })\n )\n .subscribe((isAuthenticated) => {\n const user = isAuthenticated ? this.authService.user : null;\n this._identifyUser(user);\n });\n }\n\n private _identifyUser(user: User | null): void {\n switch (this.monitoringOptions.provider) {\n case 'sentry':\n identifySentryUser(user);\n break;\n\n default:\n break;\n }\n }\n}\n","import {\n EnvironmentProviders,\n Injector,\n Provider,\n inject,\n provideAppInitializer\n} from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\nimport {\n AnyMonitoringOptions,\n MONITORING_OPTIONS\n} from '@igo2/core/monitoring';\n\nimport { AuthMonitoringService } from './auth-monitoring.service';\n\nexport function provideAuthUserMonitoring(\n options: AnyMonitoringOptions | null\n): (Provider | EnvironmentProviders)[] {\n if (!options) {\n return [];\n }\n\n return [\n {\n provide: AuthMonitoringService,\n useClass: AuthMonitoringService,\n deps: [ConfigService, MONITORING_OPTIONS, Injector]\n },\n // Force instantiate Tracing service to avoid require it in any constructor.\n provideAppInitializer(() => {\n inject(AuthMonitoringService);\n return;\n })\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAea,qBAAqB,CAAA;AAKtB,IAAA,aAAA;AAGA,IAAA,iBAAA;AACA,IAAA,QAAA;;AAPV,IAAA,WAAW;AAEX,IAAA,WAAA,CACU,aAA4B,EAG5B,iBAA8C,EAC9C,QAAkB,EAAA;QAJlB,IAAa,CAAA,aAAA,GAAb,aAAa;QAGb,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB;QACjB,IAAQ,CAAA,QAAA,GAAR,QAAQ;AAEhB,QAAA,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,EAAE;YACzC;;QAGF,IAAI,CAAC,aAAa,CAAC;AAChB,aAAA,IAAI,CACH,KAAK,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,EAC7B,SAAS,CAAC,MAAK;YACb,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC;AACjD,YAAA,OAAO,IAAI,CAAC,WAAW,EAAE,aAAa;AACxC,SAAC,CAAC;AAEH,aAAA,SAAS,CAAC,CAAC,eAAe,KAAI;AAC7B,YAAA,MAAM,IAAI,GAAG,eAAe,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI;AAC3D,YAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;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"version":3,"file":"igo2-auth-monitoring.mjs","sources":["../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.service.ts","../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.provider.ts","../../../packages/auth/monitoring/src/igo2-auth-monitoring.ts"],"sourcesContent":["import { Injectable, Injector, inject } from '@angular/core';\n\nimport { AuthService, User } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\nimport {\n AnyMonitoringOptions,\n MONITORING_OPTIONS,\n identifySentryUser\n} from '@igo2/core/monitoring';\n\nimport { first, switchMap } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthMonitoringService {\n private configService = inject(ConfigService);\n private monitoringOptions = inject<AnyMonitoringOptions | null>(\n MONITORING_OPTIONS,\n { optional: true }\n );\n private injector = inject(Injector);\n\n // The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER\n authService?: AuthService;\n\n constructor() {\n if (!this.monitoringOptions?.identifyUser) {\n return;\n }\n\n this.configService.isLoaded$\n .pipe(\n first((isLoaded) => isLoaded),\n switchMap(() => {\n this.authService = this.injector.get(AuthService);\n return this.authService?.authenticate$;\n })\n )\n .subscribe((isAuthenticated) => {\n const user = isAuthenticated ? this.authService.user : null;\n this._identifyUser(user);\n });\n }\n\n private _identifyUser(user: User | null): void {\n switch (this.monitoringOptions.provider) {\n case 'sentry':\n identifySentryUser(user);\n break;\n\n default:\n break;\n }\n }\n}\n","import {\n EnvironmentProviders,\n Injector,\n Provider,\n inject,\n provideAppInitializer\n} from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\nimport {\n AnyMonitoringOptions,\n MONITORING_OPTIONS\n} from '@igo2/core/monitoring';\n\nimport { AuthMonitoringService } from './auth-monitoring.service';\n\nexport function provideAuthUserMonitoring(\n options: AnyMonitoringOptions | null\n): (Provider | EnvironmentProviders)[] {\n if (!options) {\n return [];\n }\n\n return [\n {\n provide: AuthMonitoringService,\n useClass: AuthMonitoringService,\n deps: [ConfigService, MONITORING_OPTIONS, Injector]\n },\n // Force instantiate Tracing service to avoid require it in any constructor.\n provideAppInitializer(() => {\n inject(AuthMonitoringService);\n return;\n })\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MAea,qBAAqB,CAAA;AACxB,IAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;IACrC,iBAAiB,GAAG,MAAM,CAChC,kBAAkB,EAClB,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB;AACO,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;;AAGnC,IAAA,WAAW;AAEX,IAAA,WAAA,GAAA;AACE,QAAA,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,EAAE;YACzC;QACF;QAEA,IAAI,CAAC,aAAa,CAAC;AAChB,aAAA,IAAI,CACH,KAAK,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,EAC7B,SAAS,CAAC,MAAK;YACb,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC;AACjD,YAAA,OAAO,IAAI,CAAC,WAAW,EAAE,aAAa;AACxC,QAAA,CAAC,CAAC;AAEH,aAAA,SAAS,CAAC,CAAC,eAAe,KAAI;AAC7B,YAAA,MAAM,IAAI,GAAG,eAAe,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI;AAC3D,YAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;AAC1B,QAAA,CAAC,CAAC;IACN;AAEQ,IAAA,aAAa,CAAC,IAAiB,EAAA;AACrC,QAAA,QAAQ,IAAI,CAAC,iBAAiB,CAAC,QAAQ;AACrC,YAAA,KAAK,QAAQ;gBACX,kBAAkB,CAAC,IAAI,CAAC;gBACxB;AAEF,YAAA;gBACE;;IAEN;uGAvCW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA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