@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.
- package/environment/environment.interface.d.ts +6 -0
- package/environment/index.d.ts +5 -0
- package/esm2022/environment/environment.interface.mjs +2 -0
- package/esm2022/environment/igo2-auth-environment.mjs +5 -0
- package/esm2022/environment/public_api.mjs +2 -0
- package/esm2022/facebook/auth-facebook/auth-facebook.component.mjs +65 -0
- package/esm2022/facebook/igo2-auth-facebook.mjs +5 -0
- package/esm2022/facebook/public_api.mjs +3 -0
- package/esm2022/facebook/shared/auth-facebook.interface.mjs +2 -0
- package/esm2022/facebook/shared/index.mjs +2 -0
- package/esm2022/form/auth-form/auth-form.component.mjs +166 -0
- package/esm2022/form/auth-form.module.mjs +73 -0
- package/esm2022/form/igo2-auth-form.mjs +5 -0
- package/esm2022/form/public_api.mjs +7 -0
- package/esm2022/form/shared/auth-form.interface.mjs +2 -0
- package/esm2022/form/shared/index.mjs +2 -0
- package/esm2022/google/auth-google/auth-google.component.mjs +108 -0
- package/esm2022/google/igo2-auth-google.mjs +5 -0
- package/esm2022/google/public_api.mjs +3 -0
- package/esm2022/google/shared/auth-google.interface.mjs +2 -0
- package/esm2022/google/shared/index.mjs +2 -0
- package/esm2022/internal/auth-intern/auth-intern.component.mjs +84 -0
- package/esm2022/internal/igo2-auth-internal.mjs +5 -0
- package/esm2022/internal/public_api.mjs +2 -0
- package/esm2022/lib/auth.provider.mjs +22 -0
- package/esm2022/lib/shared/admin.guard.mjs +4 -4
- package/esm2022/lib/shared/auth-storage.interface.mjs +1 -1
- package/esm2022/lib/shared/auth-storage.service.mjs +4 -4
- package/esm2022/lib/shared/auth.guard.mjs +4 -4
- package/esm2022/lib/shared/auth.interceptor.mjs +4 -4
- package/esm2022/lib/shared/auth.interface.mjs +5 -2
- package/esm2022/lib/shared/auth.service.mjs +4 -4
- package/esm2022/lib/shared/index.mjs +3 -5
- package/esm2022/lib/shared/logged.guard.mjs +4 -4
- package/esm2022/lib/shared/profils.guard.mjs +4 -4
- package/esm2022/lib/shared/token.service.mjs +4 -4
- package/esm2022/microsoft/auth-microsoft/auth-microsoft.component.mjs +100 -0
- package/esm2022/microsoft/auth-microsoft.provider.mjs +105 -0
- package/esm2022/microsoft/auth-microsoftb2c/auth-microsoftb2c.component.mjs +98 -0
- package/esm2022/microsoft/auth-microsoftb2c/auth-msalBroadcastServiceb2c.service.mjs +47 -0
- package/esm2022/microsoft/auth-microsoftb2c/auth-msalServiceb2c.service.mjs +85 -0
- package/esm2022/microsoft/igo2-auth-microsoft.mjs +5 -0
- package/esm2022/microsoft/public_api.mjs +5 -0
- package/esm2022/microsoft/shared/auth-microsoft.interface.mjs +2 -0
- package/esm2022/microsoft/shared/index.mjs +2 -0
- package/esm2022/monitoring/auth-monitoring/auth-monitoring.provider.mjs +24 -0
- package/esm2022/monitoring/auth-monitoring/auth-monitoring.service.mjs +54 -0
- package/esm2022/monitoring/igo2-auth-monitoring.mjs +5 -0
- package/esm2022/monitoring/public_api.mjs +3 -0
- package/esm2022/public_api.mjs +3 -19
- package/{lib/auth-form → facebook/auth-facebook}/auth-facebook.component.d.ts +1 -1
- package/facebook/index.d.ts +5 -0
- package/facebook/public_api.d.ts +2 -0
- package/facebook/shared/auth-facebook.interface.d.ts +4 -0
- package/facebook/shared/index.d.ts +1 -0
- package/fesm2022/igo2-auth-environment.mjs +4 -0
- package/fesm2022/igo2-auth-environment.mjs.map +1 -0
- package/fesm2022/igo2-auth-facebook.mjs +70 -0
- package/fesm2022/igo2-auth-facebook.mjs.map +1 -0
- package/fesm2022/igo2-auth-form.mjs +238 -0
- package/fesm2022/igo2-auth-form.mjs.map +1 -0
- package/fesm2022/igo2-auth-google.mjs +112 -0
- package/fesm2022/igo2-auth-google.mjs.map +1 -0
- package/fesm2022/igo2-auth-internal.mjs +89 -0
- package/fesm2022/igo2-auth-internal.mjs.map +1 -0
- package/fesm2022/igo2-auth-microsoft.mjs +404 -0
- package/fesm2022/igo2-auth-microsoft.mjs.map +1 -0
- package/fesm2022/igo2-auth-monitoring.mjs +81 -0
- package/fesm2022/igo2-auth-monitoring.mjs.map +1 -0
- package/fesm2022/igo2-auth.mjs +241 -1145
- package/fesm2022/igo2-auth.mjs.map +1 -1
- package/{lib → form}/auth-form/auth-form.component.d.ts +3 -4
- package/form/auth-form.module.d.ts +20 -0
- package/form/index.d.ts +5 -0
- package/form/public_api.d.ts +3 -0
- package/form/shared/auth-form.interface.d.ts +9 -0
- package/form/shared/index.d.ts +1 -0
- package/{src/lib → form/src}/auth-form/auth-intern.theme.scss +19 -19
- package/form/src/auth-form.theme.scss +9 -0
- package/{lib/auth-form → google/auth-google}/auth-google.component.d.ts +1 -1
- package/google/index.d.ts +5 -0
- package/google/public_api.d.ts +2 -0
- package/google/shared/auth-google.interface.d.ts +5 -0
- package/google/shared/index.d.ts +1 -0
- package/{lib/auth-form → internal/auth-intern}/auth-intern.component.d.ts +1 -1
- package/internal/index.d.ts +5 -0
- package/internal/public_api.d.ts +1 -0
- package/lib/auth.provider.d.ts +3 -0
- package/lib/shared/auth.interface.d.ts +20 -69
- package/lib/shared/index.d.ts +2 -4
- package/locale/en.auth.json +29 -29
- package/locale/fr.auth.json +33 -33
- package/{lib/auth-form → microsoft/auth-microsoft}/auth-microsoft.component.d.ts +4 -2
- package/microsoft/auth-microsoft.provider.d.ts +12 -0
- package/{lib/auth-form → microsoft/auth-microsoftb2c}/auth-microsoftb2c.component.d.ts +5 -3
- package/{lib/shared → microsoft/auth-microsoftb2c}/auth-msalBroadcastServiceb2c.service.d.ts +1 -1
- package/microsoft/index.d.ts +5 -0
- package/microsoft/public_api.d.ts +4 -0
- package/microsoft/shared/auth-microsoft.interface.d.ts +32 -0
- package/microsoft/shared/index.d.ts +1 -0
- package/{lib → monitoring}/auth-monitoring/auth-monitoring.service.d.ts +1 -1
- package/monitoring/index.d.ts +5 -0
- package/monitoring/public_api.d.ts +2 -0
- package/package.json +46 -3
- package/public_api.d.ts +2 -18
- package/src/auth.theme.scss +9 -9
- package/esm2022/lib/auth-form/auth-facebook.component.mjs +0 -65
- package/esm2022/lib/auth-form/auth-form.component.mjs +0 -170
- package/esm2022/lib/auth-form/auth-google.component.mjs +0 -108
- package/esm2022/lib/auth-form/auth-intern.component.mjs +0 -84
- package/esm2022/lib/auth-form/auth-microsoft.component.mjs +0 -100
- package/esm2022/lib/auth-form/auth-microsoftb2c.component.mjs +0 -98
- package/esm2022/lib/auth-form/index.mjs +0 -19
- package/esm2022/lib/auth-monitoring/auth-monitoring.provider.mjs +0 -24
- package/esm2022/lib/auth-monitoring/auth-monitoring.service.mjs +0 -54
- package/esm2022/lib/auth.module.mjs +0 -98
- package/esm2022/lib/environment/environment.interface.mjs +0 -2
- package/esm2022/lib/environment/index.mjs +0 -2
- package/esm2022/lib/shared/auth-microsoft.provider.mjs +0 -86
- package/esm2022/lib/shared/auth-msalBroadcastServiceb2c.service.mjs +0 -47
- package/esm2022/lib/shared/auth-msalServiceb2c.service..mjs +0 -85
- package/esm2022/lib/shared/protected.directive.mjs +0 -21
- package/lib/auth-form/index.d.ts +0 -11
- package/lib/auth.module.d.ts +0 -24
- package/lib/environment/environment.interface.d.ts +0 -5
- package/lib/shared/auth-microsoft.provider.d.ts +0 -30
- package/lib/shared/protected.directive.d.ts +0 -8
- /package/{lib/environment/index.d.ts → environment/public_api.d.ts} +0 -0
- /package/{lib/shared/auth-msalServiceb2c.service..d.ts → microsoft/auth-microsoftb2c/auth-msalServiceb2c.service.d.ts} +0 -0
- /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,iBAA8C,EAC9C,QAAkB,EAAA;QAJlB,IAAa,CAAA,aAAA,GAAb,aAAa,CAAe;QAG5B,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAA6B;QAC9C,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;AAE1B,QAAA,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,EAAE;YACzC,OAAO;SACR;QAED,IAAI,CAAC,aAAa,CAAC,SAAS;AACzB,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,CAAC;AAClD,YAAA,OAAO,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC;AACzC,SAAC,CAAC,CACH;AACA,aAAA,SAAS,CAAC,CAAC,eAAe,KAAI;AAC7B,YAAA,MAAM,IAAI,GAAG,eAAe,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;AAC5D,YAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AAC3B,SAAC,CAAC,CAAC;KACN;AAEO,IAAA,aAAa,CAAC,IAAiB,EAAA;AACrC,QAAA,QAAQ,IAAI,CAAC,iBAAiB,CAAC,QAAQ;AACrC,YAAA,KAAK,QAAQ;gBACX,kBAAkB,CAAC,IAAI,CAAC,CAAC;gBACzB,MAAM;AAER,YAAA;gBACE,MAAM;SACT;KACF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