@igo2/auth 17.0.0-next.1 → 17.0.0-next.11

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 (130) hide show
  1. package/environment/environment.interface.d.ts +6 -0
  2. package/environment/index.d.ts +5 -0
  3. package/esm2022/environment/environment.interface.mjs +2 -0
  4. package/esm2022/environment/igo2-auth-environment.mjs +5 -0
  5. package/esm2022/environment/public_api.mjs +2 -0
  6. package/esm2022/facebook/auth-facebook/auth-facebook.component.mjs +65 -0
  7. package/esm2022/facebook/igo2-auth-facebook.mjs +5 -0
  8. package/esm2022/facebook/public_api.mjs +3 -0
  9. package/esm2022/facebook/shared/auth-facebook.interface.mjs +2 -0
  10. package/esm2022/facebook/shared/index.mjs +2 -0
  11. package/esm2022/form/auth-form/auth-form.component.mjs +166 -0
  12. package/esm2022/form/auth-form.module.mjs +73 -0
  13. package/esm2022/form/igo2-auth-form.mjs +5 -0
  14. package/esm2022/form/public_api.mjs +7 -0
  15. package/esm2022/form/shared/auth-form.interface.mjs +2 -0
  16. package/esm2022/form/shared/index.mjs +2 -0
  17. package/esm2022/google/auth-google/auth-google.component.mjs +108 -0
  18. package/esm2022/google/igo2-auth-google.mjs +5 -0
  19. package/esm2022/google/public_api.mjs +3 -0
  20. package/esm2022/google/shared/auth-google.interface.mjs +2 -0
  21. package/esm2022/google/shared/index.mjs +2 -0
  22. package/esm2022/internal/auth-intern/auth-intern.component.mjs +84 -0
  23. package/esm2022/internal/igo2-auth-internal.mjs +5 -0
  24. package/esm2022/internal/public_api.mjs +2 -0
  25. package/esm2022/lib/auth.provider.mjs +22 -0
  26. package/esm2022/lib/shared/admin.guard.mjs +4 -4
  27. package/esm2022/lib/shared/auth-storage.interface.mjs +1 -1
  28. package/esm2022/lib/shared/auth-storage.service.mjs +4 -4
  29. package/esm2022/lib/shared/auth.guard.mjs +4 -4
  30. package/esm2022/lib/shared/auth.interceptor.mjs +4 -4
  31. package/esm2022/lib/shared/auth.interface.mjs +5 -2
  32. package/esm2022/lib/shared/auth.service.mjs +4 -4
  33. package/esm2022/lib/shared/index.mjs +3 -5
  34. package/esm2022/lib/shared/logged.guard.mjs +4 -4
  35. package/esm2022/lib/shared/profils.guard.mjs +4 -4
  36. package/esm2022/lib/shared/token.service.mjs +4 -4
  37. package/esm2022/microsoft/auth-microsoft/auth-microsoft.component.mjs +100 -0
  38. package/esm2022/microsoft/auth-microsoft.provider.mjs +105 -0
  39. package/esm2022/microsoft/auth-microsoftb2c/auth-microsoftb2c.component.mjs +98 -0
  40. package/esm2022/microsoft/auth-microsoftb2c/auth-msalBroadcastServiceb2c.service.mjs +47 -0
  41. package/esm2022/microsoft/auth-microsoftb2c/auth-msalServiceb2c.service.mjs +85 -0
  42. package/esm2022/microsoft/igo2-auth-microsoft.mjs +5 -0
  43. package/esm2022/microsoft/public_api.mjs +5 -0
  44. package/esm2022/microsoft/shared/auth-microsoft.interface.mjs +2 -0
  45. package/esm2022/microsoft/shared/index.mjs +2 -0
  46. package/esm2022/monitoring/auth-monitoring/auth-monitoring.provider.mjs +24 -0
  47. package/esm2022/monitoring/auth-monitoring/auth-monitoring.service.mjs +54 -0
  48. package/esm2022/monitoring/igo2-auth-monitoring.mjs +5 -0
  49. package/esm2022/monitoring/public_api.mjs +3 -0
  50. package/esm2022/public_api.mjs +3 -19
  51. package/{lib/auth-form → facebook/auth-facebook}/auth-facebook.component.d.ts +1 -1
  52. package/facebook/index.d.ts +5 -0
  53. package/facebook/public_api.d.ts +2 -0
  54. package/facebook/shared/auth-facebook.interface.d.ts +4 -0
  55. package/facebook/shared/index.d.ts +1 -0
  56. package/fesm2022/igo2-auth-environment.mjs +4 -0
  57. package/fesm2022/igo2-auth-environment.mjs.map +1 -0
  58. package/fesm2022/igo2-auth-facebook.mjs +70 -0
  59. package/fesm2022/igo2-auth-facebook.mjs.map +1 -0
  60. package/fesm2022/igo2-auth-form.mjs +238 -0
  61. package/fesm2022/igo2-auth-form.mjs.map +1 -0
  62. package/fesm2022/igo2-auth-google.mjs +112 -0
  63. package/fesm2022/igo2-auth-google.mjs.map +1 -0
  64. package/fesm2022/igo2-auth-internal.mjs +89 -0
  65. package/fesm2022/igo2-auth-internal.mjs.map +1 -0
  66. package/fesm2022/igo2-auth-microsoft.mjs +404 -0
  67. package/fesm2022/igo2-auth-microsoft.mjs.map +1 -0
  68. package/fesm2022/igo2-auth-monitoring.mjs +81 -0
  69. package/fesm2022/igo2-auth-monitoring.mjs.map +1 -0
  70. package/fesm2022/igo2-auth.mjs +241 -1145
  71. package/fesm2022/igo2-auth.mjs.map +1 -1
  72. package/{lib → form}/auth-form/auth-form.component.d.ts +3 -4
  73. package/form/auth-form.module.d.ts +20 -0
  74. package/form/index.d.ts +5 -0
  75. package/form/public_api.d.ts +3 -0
  76. package/form/shared/auth-form.interface.d.ts +9 -0
  77. package/form/shared/index.d.ts +1 -0
  78. package/{src/lib → form/src}/auth-form/auth-intern.theme.scss +19 -19
  79. package/form/src/auth-form.theme.scss +9 -0
  80. package/{lib/auth-form → google/auth-google}/auth-google.component.d.ts +1 -1
  81. package/google/index.d.ts +5 -0
  82. package/google/public_api.d.ts +2 -0
  83. package/google/shared/auth-google.interface.d.ts +5 -0
  84. package/google/shared/index.d.ts +1 -0
  85. package/{lib/auth-form → internal/auth-intern}/auth-intern.component.d.ts +1 -1
  86. package/internal/index.d.ts +5 -0
  87. package/internal/public_api.d.ts +1 -0
  88. package/lib/auth.provider.d.ts +3 -0
  89. package/lib/shared/auth.interface.d.ts +20 -69
  90. package/lib/shared/index.d.ts +2 -4
  91. package/locale/en.auth.json +29 -29
  92. package/locale/fr.auth.json +33 -33
  93. package/{lib/auth-form → microsoft/auth-microsoft}/auth-microsoft.component.d.ts +4 -2
  94. package/microsoft/auth-microsoft.provider.d.ts +12 -0
  95. package/{lib/auth-form → microsoft/auth-microsoftb2c}/auth-microsoftb2c.component.d.ts +5 -3
  96. package/{lib/shared → microsoft/auth-microsoftb2c}/auth-msalBroadcastServiceb2c.service.d.ts +1 -1
  97. package/microsoft/index.d.ts +5 -0
  98. package/microsoft/public_api.d.ts +4 -0
  99. package/microsoft/shared/auth-microsoft.interface.d.ts +32 -0
  100. package/microsoft/shared/index.d.ts +1 -0
  101. package/{lib → monitoring}/auth-monitoring/auth-monitoring.service.d.ts +1 -1
  102. package/monitoring/index.d.ts +5 -0
  103. package/monitoring/public_api.d.ts +2 -0
  104. package/package.json +46 -3
  105. package/public_api.d.ts +2 -18
  106. package/src/auth.theme.scss +9 -9
  107. package/esm2022/lib/auth-form/auth-facebook.component.mjs +0 -65
  108. package/esm2022/lib/auth-form/auth-form.component.mjs +0 -170
  109. package/esm2022/lib/auth-form/auth-google.component.mjs +0 -108
  110. package/esm2022/lib/auth-form/auth-intern.component.mjs +0 -84
  111. package/esm2022/lib/auth-form/auth-microsoft.component.mjs +0 -100
  112. package/esm2022/lib/auth-form/auth-microsoftb2c.component.mjs +0 -98
  113. package/esm2022/lib/auth-form/index.mjs +0 -19
  114. package/esm2022/lib/auth-monitoring/auth-monitoring.provider.mjs +0 -24
  115. package/esm2022/lib/auth-monitoring/auth-monitoring.service.mjs +0 -54
  116. package/esm2022/lib/auth.module.mjs +0 -98
  117. package/esm2022/lib/environment/environment.interface.mjs +0 -2
  118. package/esm2022/lib/environment/index.mjs +0 -2
  119. package/esm2022/lib/shared/auth-microsoft.provider.mjs +0 -86
  120. package/esm2022/lib/shared/auth-msalBroadcastServiceb2c.service.mjs +0 -47
  121. package/esm2022/lib/shared/auth-msalServiceb2c.service..mjs +0 -85
  122. package/esm2022/lib/shared/protected.directive.mjs +0 -21
  123. package/lib/auth-form/index.d.ts +0 -11
  124. package/lib/auth.module.d.ts +0 -24
  125. package/lib/environment/environment.interface.d.ts +0 -5
  126. package/lib/shared/auth-microsoft.provider.d.ts +0 -30
  127. package/lib/shared/protected.directive.d.ts +0 -8
  128. /package/{lib/environment/index.d.ts → environment/public_api.d.ts} +0 -0
  129. /package/{lib/shared/auth-msalServiceb2c.service..d.ts → microsoft/auth-microsoftb2c/auth-msalServiceb2c.service.d.ts} +0 -0
  130. /package/{lib → monitoring}/auth-monitoring/auth-monitoring.provider.d.ts +0 -0
@@ -0,0 +1,81 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Optional, Inject, Injector, APP_INITIALIZER } from '@angular/core';
3
+ import * as i1 from '@igo2/core/config';
4
+ import { ConfigService } from '@igo2/core/config';
5
+ import { identifySentryUser, MONITORING_OPTIONS } from '@igo2/core/monitoring';
6
+ import { AuthService } from '@igo2/auth';
7
+ import { first, switchMap } from 'rxjs';
8
+
9
+ class AuthMonitoringService {
10
+ configService;
11
+ monitoringOptions;
12
+ injector;
13
+ // The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER
14
+ authService;
15
+ constructor(configService, monitoringOptions, injector) {
16
+ this.configService = configService;
17
+ this.monitoringOptions = monitoringOptions;
18
+ this.injector = injector;
19
+ if (!this.monitoringOptions?.identifyUser) {
20
+ return;
21
+ }
22
+ this.configService.isLoaded$
23
+ .pipe(first((isLoaded) => isLoaded), switchMap(() => {
24
+ this.authService = this.injector.get(AuthService);
25
+ return this.authService?.authenticate$;
26
+ }))
27
+ .subscribe((isAuthenticated) => {
28
+ const user = isAuthenticated ? this.authService.user : null;
29
+ this._identifyUser(user);
30
+ });
31
+ }
32
+ _identifyUser(user) {
33
+ switch (this.monitoringOptions.provider) {
34
+ case 'sentry':
35
+ identifySentryUser(user);
36
+ break;
37
+ default:
38
+ break;
39
+ }
40
+ }
41
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", 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: "17.3.9", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
43
+ }
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: AuthMonitoringService, decorators: [{
45
+ type: Injectable,
46
+ args: [{
47
+ providedIn: 'root'
48
+ }]
49
+ }], ctorParameters: () => [{ type: i1.ConfigService }, { type: undefined, decorators: [{
50
+ type: Optional
51
+ }, {
52
+ type: Inject,
53
+ args: [MONITORING_OPTIONS]
54
+ }] }, { type: i0.Injector }] });
55
+
56
+ function provideAuthUserMonitoring(options) {
57
+ if (!options) {
58
+ return [];
59
+ }
60
+ return [
61
+ {
62
+ provide: AuthMonitoringService,
63
+ useClass: AuthMonitoringService,
64
+ deps: [ConfigService, MONITORING_OPTIONS, Injector]
65
+ },
66
+ // Force instantiate Tracing service to avoid require it in any constructor.
67
+ {
68
+ provide: APP_INITIALIZER,
69
+ useFactory: () => () => { },
70
+ deps: [AuthMonitoringService],
71
+ multi: true
72
+ }
73
+ ];
74
+ }
75
+
76
+ /**
77
+ * Generated bundle index. Do not edit.
78
+ */
79
+
80
+ export { AuthMonitoringService, provideAuthUserMonitoring };
81
+ //# sourceMappingURL=igo2-auth-monitoring.mjs.map
@@ -0,0 +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';\r\n\r\nimport { AuthService, User } from '@igo2/auth';\r\nimport { ConfigService } from '@igo2/core/config';\r\nimport {\r\n AnyMonitoringOptions,\r\n MONITORING_OPTIONS,\r\n identifySentryUser\r\n} from '@igo2/core/monitoring';\r\n\r\nimport { first, switchMap } from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthMonitoringService {\r\n // The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER\r\n authService?: AuthService;\r\n\r\n constructor(\r\n private configService: ConfigService,\r\n @Optional()\r\n @Inject(MONITORING_OPTIONS)\r\n private monitoringOptions: AnyMonitoringOptions | null,\r\n private injector: Injector\r\n ) {\r\n if (!this.monitoringOptions?.identifyUser) {\r\n return;\r\n }\r\n\r\n this.configService.isLoaded$\r\n .pipe(\r\n first((isLoaded) => isLoaded),\r\n switchMap(() => {\r\n this.authService = this.injector.get(AuthService);\r\n return this.authService?.authenticate$;\r\n })\r\n )\r\n .subscribe((isAuthenticated) => {\r\n const user = isAuthenticated ? this.authService.user : null;\r\n this._identifyUser(user);\r\n });\r\n }\r\n\r\n private _identifyUser(user: User | null): void {\r\n switch (this.monitoringOptions.provider) {\r\n case 'sentry':\r\n identifySentryUser(user);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n}\r\n","import { APP_INITIALIZER, Injector, Provider } from '@angular/core';\r\n\r\nimport { ConfigService } from '@igo2/core/config';\r\nimport {\r\n AnyMonitoringOptions,\r\n MONITORING_OPTIONS\r\n} from '@igo2/core/monitoring';\r\n\r\nimport { AuthMonitoringService } from './auth-monitoring.service';\r\n\r\nexport function provideAuthUserMonitoring(\r\n options: AnyMonitoringOptions | null\r\n): Provider[] {\r\n if (!options) {\r\n return [];\r\n }\r\n\r\n return [\r\n {\r\n provide: AuthMonitoringService,\r\n useClass: AuthMonitoringService,\r\n deps: [ConfigService, MONITORING_OPTIONS, Injector]\r\n },\r\n // Force instantiate Tracing service to avoid require it in any constructor.\r\n {\r\n provide: APP_INITIALIZER,\r\n useFactory: () => () => {},\r\n deps: [AuthMonitoringService],\r\n multi: true\r\n }\r\n ];\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAea,qBAAqB,CAAA;AAKtB,IAAA,aAAA,CAAA;AAGA,IAAA,iBAAA,CAAA;AACA,IAAA,QAAA,CAAA;;AAPV,IAAA,WAAW,CAAe;AAE1B,IAAA,WAAA,CACU,aAA4B,EAG5B,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