@igo2/auth 20.0.0 → 20.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/facebook/index.d.ts +1 -2
- package/fesm2022/igo2-auth-facebook.mjs +6 -8
- package/fesm2022/igo2-auth-facebook.mjs.map +1 -1
- package/fesm2022/igo2-auth-form.mjs +11 -13
- package/fesm2022/igo2-auth-form.mjs.map +1 -1
- package/fesm2022/igo2-auth-google.mjs +6 -8
- package/fesm2022/igo2-auth-google.mjs.map +1 -1
- package/fesm2022/igo2-auth-internal.mjs +7 -9
- package/fesm2022/igo2-auth-internal.mjs.map +1 -1
- package/fesm2022/igo2-auth-microsoft.mjs +19 -23
- package/fesm2022/igo2-auth-microsoft.mjs.map +1 -1
- package/fesm2022/igo2-auth-monitoring.mjs +3 -3
- package/fesm2022/igo2-auth.mjs +24 -24
- package/form/index.d.ts +2 -2
- package/google/index.d.ts +1 -2
- package/internal/index.d.ts +1 -2
- package/microsoft/index.d.ts +2 -3
- package/package.json +4 -4
package/facebook/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter } from '@angular/core';
|
|
3
2
|
|
|
4
3
|
declare class AuthFacebookComponent {
|
|
5
4
|
private authService;
|
|
6
5
|
private config;
|
|
7
6
|
private appRef;
|
|
8
7
|
private options?;
|
|
9
|
-
login:
|
|
8
|
+
readonly login: i0.OutputEmitterRef<boolean>;
|
|
10
9
|
constructor();
|
|
11
10
|
private subscribeEvents;
|
|
12
11
|
private statusChangeCallback;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ApplicationRef,
|
|
2
|
+
import { inject, ApplicationRef, output, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { AuthService } from '@igo2/auth';
|
|
4
4
|
import { ConfigService } from '@igo2/core/config';
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ class AuthFacebookComponent {
|
|
|
8
8
|
config = inject(ConfigService);
|
|
9
9
|
appRef = inject(ApplicationRef);
|
|
10
10
|
options;
|
|
11
|
-
login =
|
|
11
|
+
login = output();
|
|
12
12
|
constructor() {
|
|
13
13
|
this.options = this.config.getConfig('auth.facebook');
|
|
14
14
|
if (this.options?.appId) {
|
|
@@ -49,15 +49,13 @@ class AuthFacebookComponent {
|
|
|
49
49
|
};
|
|
50
50
|
fjs.parentNode.insertBefore(js, fjs);
|
|
51
51
|
}
|
|
52
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
53
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
52
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthFacebookComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
53
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: AuthFacebookComponent, isStandalone: true, selector: "igo-auth-facebook", outputs: { login: "login" }, ngImport: i0, template: "<div\n class=\"fb-login-button\"\n data-max-rows=\"1\"\n data-size=\"large\"\n data-button-type=\"login_with\"\n data-show-faces=\"false\"\n data-auto-logout-link=\"false\"\n data-use-continue-as=\"false\"\n></div>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-3px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
54
54
|
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthFacebookComponent, decorators: [{
|
|
56
56
|
type: Component,
|
|
57
57
|
args: [{ selector: 'igo-auth-facebook', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div\n class=\"fb-login-button\"\n data-max-rows=\"1\"\n data-size=\"large\"\n data-button-type=\"login_with\"\n data-show-faces=\"false\"\n data-auto-logout-link=\"false\"\n data-use-continue-as=\"false\"\n></div>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-3px}\n"] }]
|
|
58
|
-
}], ctorParameters: () => [], propDecorators: { login: [{
|
|
59
|
-
type: Output
|
|
60
|
-
}] } });
|
|
58
|
+
}], ctorParameters: () => [], propDecorators: { login: [{ type: i0.Output, args: ["login"] }] } });
|
|
61
59
|
|
|
62
60
|
/**
|
|
63
61
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"igo2-auth-facebook.mjs","sources":["../../../packages/auth/facebook/src/auth-facebook/auth-facebook.component.ts","../../../packages/auth/facebook/src/auth-facebook/auth-facebook.component.html","../../../packages/auth/facebook/src/igo2-auth-facebook.ts"],"sourcesContent":["import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n
|
|
1
|
+
{"version":3,"file":"igo2-auth-facebook.mjs","sources":["../../../packages/auth/facebook/src/auth-facebook/auth-facebook.component.ts","../../../packages/auth/facebook/src/auth-facebook/auth-facebook.component.html","../../../packages/auth/facebook/src/igo2-auth-facebook.ts"],"sourcesContent":["import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n inject,\n output\n} from '@angular/core';\n\nimport { AuthService } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\n\nimport { AuthFacebookOptions } from '../shared/auth-facebook.interface';\n\n@Component({\n selector: 'igo-auth-facebook',\n templateUrl: './auth-facebook.component.html',\n styleUrls: ['./auth-facebook.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class AuthFacebookComponent {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private appRef = inject(ApplicationRef);\n\n private options?: AuthFacebookOptions;\n\n readonly login = output<boolean>();\n\n constructor() {\n this.options = this.config.getConfig('auth.facebook');\n\n if (this.options?.appId) {\n this.loadSDKFacebook();\n } else {\n console.warn('Facebook authentification needs \"appId\" option');\n }\n }\n\n private subscribeEvents() {\n (window as any).FB.Event.subscribe('auth.statusChange', (rep) => {\n this.statusChangeCallback(rep);\n });\n }\n\n private statusChangeCallback(response) {\n if (response.status === 'connected') {\n const accessToken = response.authResponse.accessToken;\n this.loginFacebook(accessToken);\n }\n }\n\n private loginFacebook(token) {\n this.authService.loginWithToken(token, 'facebook').subscribe(() => {\n this.appRef.tick();\n this.login.emit(true);\n });\n }\n\n private loadSDKFacebook() {\n if (document.getElementById('facebook-jssdk')) {\n return;\n }\n\n const urlSDK =\n 'https://connect.facebook.net/fr_CA/sdk.js#xfbml=1&version=v2.9';\n\n const fjs = document.getElementsByTagName('script')[0];\n const js = document.createElement('script');\n js.id = 'facebook-jssdk';\n js.src = `${urlSDK}&appId=${this.options?.appId}`;\n js.onload = () => {\n this.subscribeEvents();\n };\n fjs.parentNode.insertBefore(js, fjs);\n }\n}\n","<div\n class=\"fb-login-button\"\n data-max-rows=\"1\"\n data-size=\"large\"\n data-button-type=\"login_with\"\n data-show-faces=\"false\"\n data-auto-logout-link=\"false\"\n data-use-continue-as=\"false\"\n></div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;MAoBa,qBAAqB,CAAA;AACxB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;AAC9B,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;AAE/B,IAAA,OAAO;IAEN,KAAK,GAAG,MAAM,EAAW;AAElC,IAAA,WAAA,GAAA;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC;AAErD,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE;YACvB,IAAI,CAAC,eAAe,EAAE;QACxB;aAA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AC,eAAe,EAAE;AACxB,QAAA,CAAC;QACD,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,EAAE,GAAG,CAAC;IACtC;uGAvDW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,0GCpBlC,iOASA,EAAA,MAAA,EAAA,CAAA,mFAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDWa,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAAA,eAAA,EAGZ,uBAAuB,CAAC,MAAM,cACnC,IAAI,EAAA,QAAA,EAAA,iOAAA,EAAA,MAAA,EAAA,CAAA,mFAAA,CAAA,EAAA;;;AElBlB;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject,
|
|
3
|
+
import { inject, output, Input, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
4
4
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import * as i1 from '@angular/material/button';
|
|
6
6
|
import { MatButtonModule } from '@angular/material/button';
|
|
@@ -73,7 +73,7 @@ class AuthFormComponent {
|
|
|
73
73
|
return true;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
login =
|
|
76
|
+
login = output();
|
|
77
77
|
options;
|
|
78
78
|
user;
|
|
79
79
|
visible = true;
|
|
@@ -134,10 +134,10 @@ class AuthFormComponent {
|
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
138
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
137
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
138
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.6", type: AuthFormComponent, isStandalone: true, selector: "igo-auth-form", inputs: { backgroundDisable: "backgroundDisable", hasAlreadyConnectedDiv: "hasAlreadyConnectedDiv", hasLogoutDiv: "hasLogoutDiv", showAlreadyConnectedDiv: "showAlreadyConnectedDiv", showLogoutDiv: "showLogoutDiv" }, outputs: { login: "login" }, ngImport: i0, template: "@if (visible) {\n <div>\n @if (!auth.logged && backgroundDisable) {\n <div class=\"backgroundDisable\"></div>\n }\n @if (!auth.logged && showLoginDiv) {\n <div class=\"login center-block\">\n <h3>{{ 'igo.auth.connection' | translate }}</h3>\n @if (options.google && options.google.enabled !== false) {\n <igo-auth-google (login)=\"onLogin()\" />\n }\n @if (options.microsoft && options.microsoft.enabled !== false) {\n <igo-auth-microsoft (login)=\"onLogin()\" />\n }\n @if (options.microsoftb2c && options.microsoftb2c.enabled !== false) {\n <igo-auth-microsoftb2c (login)=\"onLogin()\" />\n }\n @if (options.facebook && options.facebook.enabled !== false) {\n <igo-auth-facebook (login)=\"onLogin()\" />\n }\n @if (!options.intern || options.intern.enabled !== false) {\n <igo-auth-intern\n [allowAnonymous]=\"options.allowAnonymous\"\n (login)=\"onLogin()\"\n />\n }\n </div>\n }\n @if (auth.logged && showAlreadyConnectedDiv) {\n <div class=\"login center-block\">\n <p>{{ 'igo.auth.welcome' | translate: user }}</p>\n <button matButton=\"elevated\" type=\"button\" (click)=\"logout()\">\n {{ 'igo.auth.signOut' | translate }}\n </button>\n </div>\n }\n @if (showLogoutDiv) {\n <div class=\"login center-block\">\n <p>{{ 'igo.auth.deconnection' | translate }}</p>\n @if (options.homeRoute) {\n <button matButton=\"elevated\" type=\"button\" (click)=\"home()\">\n {{ 'igo.auth.home' | translate }}\n </button>\n }\n </div>\n }\n </div>\n}\n", styles: [":host{z-index:999}div.login{z-index:200;width:90%;min-width:360px;max-width:600px;padding:24px 48px;border:1px solid;background-color:#fff;border-color:#888}div.login h3{margin-top:0}.center-block{position:fixed;top:20%;left:50%;transform:translate(-50%)}.backgroundDisable{position:fixed;top:0;left:0;background:#000;opacity:.8;z-index:100;height:100%;width:100%}\n"], dependencies: [{ kind: "component", type: AuthGoogleComponent, selector: "igo-auth-google", outputs: ["login"] }, { kind: "component", type: AuthMicrosoftComponent, selector: "igo-auth-microsoft", outputs: ["login"] }, { kind: "component", type: AuthMicrosoftb2cComponent, selector: "igo-auth-microsoftb2c", outputs: ["login"] }, { kind: "component", type: AuthFacebookComponent, selector: "igo-auth-facebook", outputs: ["login"] }, { kind: "component", type: AuthInternComponent, selector: "igo-auth-intern", inputs: ["allowAnonymous"], outputs: ["login"] }, { 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: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
139
139
|
}
|
|
140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthFormComponent, decorators: [{
|
|
141
141
|
type: Component,
|
|
142
142
|
args: [{ selector: 'igo-auth-form', changeDetection: ChangeDetectionStrategy.Default, imports: [
|
|
143
143
|
AuthGoogleComponent,
|
|
@@ -147,7 +147,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
147
147
|
AuthInternComponent,
|
|
148
148
|
MatButtonModule,
|
|
149
149
|
IgoLanguageModule
|
|
150
|
-
], template: "@if (visible) {\n <div>\n @if (!auth.logged && backgroundDisable) {\n <div class=\"backgroundDisable\"></div>\n }\n @if (!auth.logged && showLoginDiv) {\n <div class=\"login center-block\">\n <h3>{{ 'igo.auth.connection' | translate }}</h3>\n @if (options.google && options.google.enabled !== false) {\n <igo-auth-google (login)=\"onLogin()\"
|
|
150
|
+
], template: "@if (visible) {\n <div>\n @if (!auth.logged && backgroundDisable) {\n <div class=\"backgroundDisable\"></div>\n }\n @if (!auth.logged && showLoginDiv) {\n <div class=\"login center-block\">\n <h3>{{ 'igo.auth.connection' | translate }}</h3>\n @if (options.google && options.google.enabled !== false) {\n <igo-auth-google (login)=\"onLogin()\" />\n }\n @if (options.microsoft && options.microsoft.enabled !== false) {\n <igo-auth-microsoft (login)=\"onLogin()\" />\n }\n @if (options.microsoftb2c && options.microsoftb2c.enabled !== false) {\n <igo-auth-microsoftb2c (login)=\"onLogin()\" />\n }\n @if (options.facebook && options.facebook.enabled !== false) {\n <igo-auth-facebook (login)=\"onLogin()\" />\n }\n @if (!options.intern || options.intern.enabled !== false) {\n <igo-auth-intern\n [allowAnonymous]=\"options.allowAnonymous\"\n (login)=\"onLogin()\"\n />\n }\n </div>\n }\n @if (auth.logged && showAlreadyConnectedDiv) {\n <div class=\"login center-block\">\n <p>{{ 'igo.auth.welcome' | translate: user }}</p>\n <button matButton=\"elevated\" type=\"button\" (click)=\"logout()\">\n {{ 'igo.auth.signOut' | translate }}\n </button>\n </div>\n }\n @if (showLogoutDiv) {\n <div class=\"login center-block\">\n <p>{{ 'igo.auth.deconnection' | translate }}</p>\n @if (options.homeRoute) {\n <button matButton=\"elevated\" type=\"button\" (click)=\"home()\">\n {{ 'igo.auth.home' | translate }}\n </button>\n }\n </div>\n }\n </div>\n}\n", styles: [":host{z-index:999}div.login{z-index:200;width:90%;min-width:360px;max-width:600px;padding:24px 48px;border:1px solid;background-color:#fff;border-color:#888}div.login h3{margin-top:0}.center-block{position:fixed;top:20%;left:50%;transform:translate(-50%)}.backgroundDisable{position:fixed;top:0;left:0;background:#000;opacity:.8;z-index:100;height:100%;width:100%}\n"] }]
|
|
151
151
|
}], ctorParameters: () => [], propDecorators: { backgroundDisable: [{
|
|
152
152
|
type: Input
|
|
153
153
|
}], hasAlreadyConnectedDiv: [{
|
|
@@ -158,13 +158,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
158
158
|
type: Input
|
|
159
159
|
}], showLogoutDiv: [{
|
|
160
160
|
type: Input
|
|
161
|
-
}], login: [{
|
|
162
|
-
type: Output
|
|
163
|
-
}] } });
|
|
161
|
+
}], login: [{ type: i0.Output, args: ["login"] }] } });
|
|
164
162
|
|
|
165
163
|
class IgoAuthFormModule {
|
|
166
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
167
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
164
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoAuthFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
165
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: IgoAuthFormModule, imports: [CommonModule,
|
|
168
166
|
ReactiveFormsModule,
|
|
169
167
|
MatFormFieldModule,
|
|
170
168
|
MatInputModule,
|
|
@@ -179,7 +177,7 @@ class IgoAuthFormModule {
|
|
|
179
177
|
AuthFacebookComponent,
|
|
180
178
|
AuthMicrosoftComponent,
|
|
181
179
|
AuthMicrosoftb2cComponent], exports: [AuthFormComponent] });
|
|
182
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
180
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoAuthFormModule, imports: [CommonModule,
|
|
183
181
|
ReactiveFormsModule,
|
|
184
182
|
MatFormFieldModule,
|
|
185
183
|
MatInputModule,
|
|
@@ -195,7 +193,7 @@ class IgoAuthFormModule {
|
|
|
195
193
|
AuthMicrosoftComponent,
|
|
196
194
|
AuthMicrosoftb2cComponent] });
|
|
197
195
|
}
|
|
198
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoAuthFormModule, decorators: [{
|
|
199
197
|
type: NgModule,
|
|
200
198
|
args: [{
|
|
201
199
|
imports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"igo2-auth-form.mjs","sources":["../../../packages/auth/form/src/auth-form/auth-form.component.ts","../../../packages/auth/form/src/auth-form/auth-form.component.html","../../../packages/auth/form/src/auth-form.module.ts","../../../packages/auth/form/src/public_api.ts","../../../packages/auth/form/src/igo2-auth-form.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n inject\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { NavigationStart, Router } from '@angular/router';\n\nimport { AuthOptions, AuthService } from '@igo2/auth';\nimport { AuthFacebookComponent } from '@igo2/auth/facebook';\nimport { AuthGoogleComponent } from '@igo2/auth/google';\nimport { AuthInternComponent } from '@igo2/auth/internal';\nimport {\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent\n} from '@igo2/auth/microsoft';\nimport { ConfigService } from '@igo2/core/config';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { filter } from 'rxjs/operators';\n\nimport { AuthFormOptions } from '../shared';\n\n@Component({\n selector: 'igo-auth-form',\n templateUrl: './auth-form.component.html',\n styleUrls: ['./auth-form.component.scss'],\n changeDetection: ChangeDetectionStrategy.Default,\n imports: [\n AuthGoogleComponent,\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent,\n AuthFacebookComponent,\n AuthInternComponent,\n MatButtonModule,\n IgoLanguageModule\n ]\n})\nexport class AuthFormComponent implements OnInit {\n auth = inject(AuthService);\n private config = inject(ConfigService);\n private router = inject(Router, { optional: true });\n\n @Input()\n get backgroundDisable(): boolean {\n if (this.isLogoutRoute || this.isLogoutRoute) {\n return false;\n }\n return this._backgroundDisable;\n }\n set backgroundDisable(value: boolean) {\n this._backgroundDisable = value.toString() === 'true';\n }\n private _backgroundDisable = true;\n\n @Input()\n get hasAlreadyConnectedDiv(): boolean {\n return this._hasAlreadyConnectedDiv;\n }\n set hasAlreadyConnectedDiv(value: boolean) {\n this._hasAlreadyConnectedDiv = value.toString() === 'true';\n }\n private _hasAlreadyConnectedDiv = true;\n\n @Input()\n get hasLogoutDiv(): boolean {\n return this._hasLogoutDiv;\n }\n set hasLogoutDiv(value: boolean) {\n this._hasLogoutDiv = value.toString() === 'true';\n }\n private _hasLogoutDiv = true;\n\n @Input()\n get showAlreadyConnectedDiv(): boolean {\n if (this.isLogoutRoute) {\n return this.hasAlreadyConnectedDiv;\n }\n return this._showAlreadyConnectedDiv;\n }\n set showAlreadyConnectedDiv(value: boolean) {\n this._showAlreadyConnectedDiv = value.toString() === 'true';\n }\n private _showAlreadyConnectedDiv = false;\n\n @Input()\n get showLogoutDiv(): boolean {\n if (this.isLogoutRoute) {\n return this.hasLogoutDiv;\n }\n return this._showLogoutDiv;\n }\n set showLogoutDiv(value: boolean) {\n this._showLogoutDiv = value.toString() === 'true';\n }\n private _showLogoutDiv = false;\n\n get showLoginDiv(): boolean {\n if (!this.isLogoutRoute) {\n return true;\n }\n }\n\n @Output() login: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n public options?: AuthOptions & AuthFormOptions;\n public user;\n\n public visible = true;\n\n private isLogoutRoute: boolean;\n\n constructor() {\n this.options = this.config.getConfig('auth');\n this.visible = Object.getOwnPropertyNames(this.options).length !== 0;\n }\n\n public ngOnInit() {\n this.analyzeRoute();\n this.getName();\n }\n\n public onLogin() {\n this.auth.goToRedirectUrl();\n this.getName();\n this.login.emit(true);\n }\n\n public logout() {\n this.auth.logout().subscribe(() => {\n this.user = undefined;\n if (this.router) {\n if (this.options?.logoutRoute) {\n this.router.navigate([this.options?.logoutRoute]);\n } else if (this.options?.homeRoute) {\n this.router.navigate([this.options?.homeRoute]);\n }\n }\n });\n }\n\n public home() {\n if (this.router && this.options?.homeRoute) {\n this.router.navigate([this.options?.homeRoute]);\n }\n }\n\n private getName() {\n const tokenDecoded = this.auth.decodeToken();\n if (tokenDecoded) {\n this.user = {\n name: tokenDecoded.user.firstName || tokenDecoded.user.sourceId\n };\n }\n }\n\n private analyzeRoute() {\n if (!this.router) {\n return;\n }\n\n this.router.events\n .pipe(filter((event) => event instanceof NavigationStart))\n .subscribe((changeEvent: any) => {\n if (changeEvent.url) {\n const currentRoute = changeEvent.url;\n const logoutRoute = this.options?.logoutRoute;\n\n this.isLogoutRoute = currentRoute === logoutRoute;\n\n if (this.isLogoutRoute) {\n this.auth.logout();\n }\n }\n });\n }\n}\n","@if (visible) {\n <div>\n @if (!auth.logged && backgroundDisable) {\n <div class=\"backgroundDisable\"></div>\n }\n @if (!auth.logged && showLoginDiv) {\n <div class=\"login center-block\">\n <h3>{{ 'igo.auth.connection' | translate }}</h3>\n @if (options.google && options.google.enabled !== false) {\n <igo-auth-google (login)=\"onLogin()\"> </igo-auth-google>\n }\n @if (options.microsoft && options.microsoft.enabled !== false) {\n <igo-auth-microsoft (login)=\"onLogin()\"> </igo-auth-microsoft>\n }\n @if (options.microsoftb2c && options.microsoftb2c.enabled !== false) {\n <igo-auth-microsoftb2c (login)=\"onLogin()\"> </igo-auth-microsoftb2c>\n }\n @if (options.facebook && options.facebook.enabled !== false) {\n <igo-auth-facebook (login)=\"onLogin()\"> </igo-auth-facebook>\n }\n @if (!options.intern || options.intern.enabled !== false) {\n <igo-auth-intern\n [allowAnonymous]=\"options.allowAnonymous\"\n (login)=\"onLogin()\"\n >\n </igo-auth-intern>\n }\n </div>\n }\n @if (auth.logged && showAlreadyConnectedDiv) {\n <div class=\"login center-block\">\n <p>{{ 'igo.auth.welcome' | translate: user }}</p>\n <button matButton=\"elevated\" type=\"button\" (click)=\"logout()\">\n {{ 'igo.auth.signOut' | translate }}\n </button>\n </div>\n }\n @if (showLogoutDiv) {\n <div class=\"login center-block\">\n <p>{{ 'igo.auth.deconnection' | translate }}</p>\n @if (options.homeRoute) {\n <button matButton=\"elevated\" type=\"button\" (click)=\"home()\">\n {{ 'igo.auth.home' | translate }}\n </button>\n }\n </div>\n }\n </div>\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\n\nimport { AuthFacebookComponent } from '@igo2/auth/facebook';\nimport { AuthGoogleComponent } from '@igo2/auth/google';\nimport { AuthInternComponent } from '@igo2/auth/internal';\nimport {\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent\n} from '@igo2/auth/microsoft';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { MsalModule } from '@azure/msal-angular';\n\nimport { AuthFormComponent } from './auth-form/auth-form.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n MatInputModule,\n MatIconModule,\n MatProgressSpinnerModule,\n MatButtonModule,\n IgoLanguageModule,\n MsalModule,\n AuthFormComponent,\n AuthGoogleComponent,\n AuthInternComponent,\n AuthFacebookComponent,\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent\n ],\n exports: [AuthFormComponent]\n})\nexport class IgoAuthFormModule {}\n","/*\n * Public API Surface of auth\n */\n\nexport * from './shared/auth-form.interface';\nexport * from './auth-form.module';\n\nexport * from './auth-form/auth-form.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;MA0Ca,iBAAiB,CAAA;AAC5B,IAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;AAClB,IAAA,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;IAC9B,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAEnD,IAAA,IACI,iBAAiB,GAAA;QACnB,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,EAAE;AAC5C,YAAA,OAAO,KAAK;QACd;QACA,OAAO,IAAI,CAAC,kBAAkB;IAChC;IACA,IAAI,iBAAiB,CAAC,KAAc,EAAA;QAClC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,MAAM;IACvD;IACQ,kBAAkB,GAAG,IAAI;AAEjC,IAAA,IACI,sBAAsB,GAAA;QACxB,OAAO,IAAI,CAAC,uBAAuB;IACrC;IACA,IAAI,sBAAsB,CAAC,KAAc,EAAA;QACvC,IAAI,CAAC,uBAAuB,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,MAAM;IAC5D;IACQ,uBAAuB,GAAG,IAAI;AAEtC,IAAA,IACI,YAAY,GAAA;QACd,OAAO,IAAI,CAAC,aAAa;IAC3B;IACA,IAAI,YAAY,CAAC,KAAc,EAAA;QAC7B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,MAAM;IAClD;IACQ,aAAa,GAAG,IAAI;AAE5B,IAAA,IACI,uBAAuB,GA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AAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAlB1B,YAAY;YACZ,mBAAmB;YACnB,kBAAkB;YAClB,cAAc;YACd,aAAa;YACb,wBAAwB;YACxB,eAAe;YACf,iBAAiB;YACjB,UAAU;YACV,iBAAiB;YACjB,mBAAmB;YACnB,mBAAmB;YACnB,qBAAqB;YACrB,sBAAsB;AACtB,YAAA,yBAAyB,aAEjB,iBAAiB,CAAA,EAAA,CAAA;AAEhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAlB1B,YAAY;YACZ,mBAAmB;YACnB,kBAAkB;YAClB,cAAc;YACd,aAAa;YACb,wBAAwB;YACxB,eAAe;YACf,iBAAiB;YACjB,UAAU;YACV,iBAAiB;YACjB,mBAAmB;YACnB,mBAAmB;YACnB,qBAAqB;YACrB,sBAAsB;YACtB,yBAAyB,CAAA,EAAA,CAAA;;2FAIhB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBApB7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,kBAAkB;wBAClB,cAAc;wBACd,aAAa;wBACb,wBAAwB;wBACxB,eAAe;wBACf,iBAAiB;wBACjB,UAAU;wBACV,iBAAiB;wBACjB,mBAAmB;wBACnB,mBAAmB;wBACnB,qBAAqB;wBACrB,sBAAsB;wBACtB;AACD,qBAAA;oBACD,OAAO,EAAE,CAAC,iBAAiB;AAC5B,iBAAA;;;ACzCD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"igo2-auth-form.mjs","sources":["../../../packages/auth/form/src/auth-form/auth-form.component.ts","../../../packages/auth/form/src/auth-form/auth-form.component.html","../../../packages/auth/form/src/auth-form.module.ts","../../../packages/auth/form/src/public_api.ts","../../../packages/auth/form/src/igo2-auth-form.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n OnInit,\n inject,\n output\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { NavigationStart, Router } from '@angular/router';\n\nimport { AuthOptions, AuthService } from '@igo2/auth';\nimport { AuthFacebookComponent } from '@igo2/auth/facebook';\nimport { AuthGoogleComponent } from '@igo2/auth/google';\nimport { AuthInternComponent } from '@igo2/auth/internal';\nimport {\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent\n} from '@igo2/auth/microsoft';\nimport { ConfigService } from '@igo2/core/config';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { filter } from 'rxjs/operators';\n\nimport { AuthFormOptions } from '../shared';\n\n@Component({\n selector: 'igo-auth-form',\n templateUrl: './auth-form.component.html',\n styleUrls: ['./auth-form.component.scss'],\n changeDetection: ChangeDetectionStrategy.Default,\n imports: [\n AuthGoogleComponent,\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent,\n AuthFacebookComponent,\n AuthInternComponent,\n MatButtonModule,\n IgoLanguageModule\n ]\n})\nexport class AuthFormComponent implements OnInit {\n auth = inject(AuthService);\n private config = inject(ConfigService);\n private router = inject(Router, { optional: true });\n\n @Input()\n get backgroundDisable(): boolean {\n if (this.isLogoutRoute || this.isLogoutRoute) {\n return false;\n }\n return this._backgroundDisable;\n }\n set backgroundDisable(value: boolean) {\n this._backgroundDisable = value.toString() === 'true';\n }\n private _backgroundDisable = true;\n\n @Input()\n get hasAlreadyConnectedDiv(): boolean {\n return this._hasAlreadyConnectedDiv;\n }\n set hasAlreadyConnectedDiv(value: boolean) {\n this._hasAlreadyConnectedDiv = value.toString() === 'true';\n }\n private _hasAlreadyConnectedDiv = true;\n\n @Input()\n get hasLogoutDiv(): boolean {\n return this._hasLogoutDiv;\n }\n set hasLogoutDiv(value: boolean) {\n this._hasLogoutDiv = value.toString() === 'true';\n }\n private _hasLogoutDiv = true;\n\n @Input()\n get showAlreadyConnectedDiv(): boolean {\n if (this.isLogoutRoute) {\n return this.hasAlreadyConnectedDiv;\n }\n return this._showAlreadyConnectedDiv;\n }\n set showAlreadyConnectedDiv(value: boolean) {\n this._showAlreadyConnectedDiv = value.toString() === 'true';\n }\n private _showAlreadyConnectedDiv = false;\n\n @Input()\n get showLogoutDiv(): boolean {\n if (this.isLogoutRoute) {\n return this.hasLogoutDiv;\n }\n return this._showLogoutDiv;\n }\n set showLogoutDiv(value: boolean) {\n this._showLogoutDiv = value.toString() === 'true';\n }\n private _showLogoutDiv = false;\n\n get showLoginDiv(): boolean {\n if (!this.isLogoutRoute) {\n return true;\n }\n }\n\n readonly login = output<boolean>();\n\n public options?: AuthOptions & AuthFormOptions;\n public user;\n\n public visible = true;\n\n private isLogoutRoute: boolean;\n\n constructor() {\n this.options = this.config.getConfig('auth');\n this.visible = Object.getOwnPropertyNames(this.options).length !== 0;\n }\n\n public ngOnInit() {\n this.analyzeRoute();\n this.getName();\n }\n\n public onLogin() {\n this.auth.goToRedirectUrl();\n this.getName();\n this.login.emit(true);\n }\n\n public logout() {\n this.auth.logout().subscribe(() => {\n this.user = undefined;\n if (this.router) {\n if (this.options?.logoutRoute) {\n this.router.navigate([this.options?.logoutRoute]);\n } else if (this.options?.homeRoute) {\n this.router.navigate([this.options?.homeRoute]);\n }\n }\n });\n }\n\n public home() {\n if (this.router && this.options?.homeRoute) {\n this.router.navigate([this.options?.homeRoute]);\n }\n }\n\n private getName() {\n const tokenDecoded = this.auth.decodeToken();\n if (tokenDecoded) {\n this.user = {\n name: tokenDecoded.user.firstName || tokenDecoded.user.sourceId\n };\n }\n }\n\n private analyzeRoute() {\n if (!this.router) {\n return;\n }\n\n this.router.events\n .pipe(filter((event) => event instanceof NavigationStart))\n .subscribe((changeEvent: any) => {\n if (changeEvent.url) {\n const currentRoute = changeEvent.url;\n const logoutRoute = this.options?.logoutRoute;\n\n this.isLogoutRoute = currentRoute === logoutRoute;\n\n if (this.isLogoutRoute) {\n this.auth.logout();\n }\n }\n });\n }\n}\n","@if (visible) {\n <div>\n @if (!auth.logged && backgroundDisable) {\n <div class=\"backgroundDisable\"></div>\n }\n @if (!auth.logged && showLoginDiv) {\n <div class=\"login center-block\">\n <h3>{{ 'igo.auth.connection' | translate }}</h3>\n @if (options.google && options.google.enabled !== false) {\n <igo-auth-google (login)=\"onLogin()\" />\n }\n @if (options.microsoft && options.microsoft.enabled !== false) {\n <igo-auth-microsoft (login)=\"onLogin()\" />\n }\n @if (options.microsoftb2c && options.microsoftb2c.enabled !== false) {\n <igo-auth-microsoftb2c (login)=\"onLogin()\" />\n }\n @if (options.facebook && options.facebook.enabled !== false) {\n <igo-auth-facebook (login)=\"onLogin()\" />\n }\n @if (!options.intern || options.intern.enabled !== false) {\n <igo-auth-intern\n [allowAnonymous]=\"options.allowAnonymous\"\n (login)=\"onLogin()\"\n />\n }\n </div>\n }\n @if (auth.logged && showAlreadyConnectedDiv) {\n <div class=\"login center-block\">\n <p>{{ 'igo.auth.welcome' | translate: user }}</p>\n <button matButton=\"elevated\" type=\"button\" (click)=\"logout()\">\n {{ 'igo.auth.signOut' | translate }}\n </button>\n </div>\n }\n @if (showLogoutDiv) {\n <div class=\"login center-block\">\n <p>{{ 'igo.auth.deconnection' | translate }}</p>\n @if (options.homeRoute) {\n <button matButton=\"elevated\" type=\"button\" (click)=\"home()\">\n {{ 'igo.auth.home' | translate }}\n </button>\n }\n </div>\n }\n </div>\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\n\nimport { AuthFacebookComponent } from '@igo2/auth/facebook';\nimport { AuthGoogleComponent } from '@igo2/auth/google';\nimport { AuthInternComponent } from '@igo2/auth/internal';\nimport {\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent\n} from '@igo2/auth/microsoft';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { MsalModule } from '@azure/msal-angular';\n\nimport { AuthFormComponent } from './auth-form/auth-form.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n MatInputModule,\n MatIconModule,\n MatProgressSpinnerModule,\n MatButtonModule,\n IgoLanguageModule,\n MsalModule,\n AuthFormComponent,\n AuthGoogleComponent,\n AuthInternComponent,\n AuthFacebookComponent,\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent\n ],\n exports: [AuthFormComponent]\n})\nexport class IgoAuthFormModule {}\n","/*\n * Public API Surface of auth\n */\n\nexport * from './shared/auth-form.interface';\nexport * from './auth-form.module';\n\nexport * from './auth-form/auth-form.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAyCa,iBAAiB,CAAA;AAC5B,IAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;AAClB,IAAA,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;IAC9B,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAEnD,IAAA,IACI,iBAAiB,GAAA;QACnB,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,EAAE;AAC5C,YAAA,OAAO,KAAK;QACd;QACA,OAAO,IAAI,CAAC,kBAAkB;IAChC;IACA,IAAI,iBAAiB,CAAC,KAAc,EAAA;QAClC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,MAAM;IACvD;IACQ,kBAAkB,GAAG,IAAI;AAEjC,IAAA,IACI,sBAAsB,GAAA;QACxB,OAAO,IAAI,CAAC,uBAAuB;IACrC;IACA,IAAI,sBAAsB,CAAC,KAAc,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|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ApplicationRef,
|
|
2
|
+
import { inject, ApplicationRef, output, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { AuthService } from '@igo2/auth';
|
|
4
4
|
import { ConfigService } from '@igo2/core/config';
|
|
5
5
|
import { LanguageService } from '@igo2/core/language';
|
|
@@ -10,7 +10,7 @@ class AuthGoogleComponent {
|
|
|
10
10
|
languageService = inject(LanguageService);
|
|
11
11
|
appRef = inject(ApplicationRef);
|
|
12
12
|
options;
|
|
13
|
-
login =
|
|
13
|
+
login = output();
|
|
14
14
|
constructor() {
|
|
15
15
|
this.options = this.config.getConfig('auth.google');
|
|
16
16
|
if (this.options?.apiKey && this.options?.clientId) {
|
|
@@ -90,15 +90,13 @@ class AuthGoogleComponent {
|
|
|
90
90
|
js.src = 'https://apis.google.com/js/platform.js';
|
|
91
91
|
fjs.parentNode.insertBefore(js, fjs);
|
|
92
92
|
}
|
|
93
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
94
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
93
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthGoogleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
94
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: AuthGoogleComponent, isStandalone: true, selector: "igo-auth-google", outputs: { login: "login" }, ngImport: i0, template: "<div\n class=\"g-signin2 google-login-button\"\n data-height=\"40\"\n data-width=\"265\"\n data-longtitle=\"true\"\n></div>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block}.google-login-button ::ng-deep .abcRioButton{color:#000000de}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
95
95
|
}
|
|
96
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthGoogleComponent, decorators: [{
|
|
97
97
|
type: Component,
|
|
98
98
|
args: [{ selector: 'igo-auth-google', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div\n class=\"g-signin2 google-login-button\"\n data-height=\"40\"\n data-width=\"265\"\n data-longtitle=\"true\"\n></div>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block}.google-login-button ::ng-deep .abcRioButton{color:#000000de}\n"] }]
|
|
99
|
-
}], ctorParameters: () => [], propDecorators: { login: [{
|
|
100
|
-
type: Output
|
|
101
|
-
}] } });
|
|
99
|
+
}], ctorParameters: () => [], propDecorators: { login: [{ type: i0.Output, args: ["login"] }] } });
|
|
102
100
|
|
|
103
101
|
/**
|
|
104
102
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"igo2-auth-google.mjs","sources":["../../../packages/auth/google/src/auth-google/auth-google.component.ts","../../../packages/auth/google/src/auth-google/auth-google.component.html","../../../packages/auth/google/src/igo2-auth-google.ts"],"sourcesContent":["import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n
|
|
1
|
+
{"version":3,"file":"igo2-auth-google.mjs","sources":["../../../packages/auth/google/src/auth-google/auth-google.component.ts","../../../packages/auth/google/src/auth-google/auth-google.component.html","../../../packages/auth/google/src/igo2-auth-google.ts"],"sourcesContent":["import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n inject,\n output\n} from '@angular/core';\n\nimport { AuthService } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\nimport { LanguageService } from '@igo2/core/language';\n\nimport { AuthGoogleOptions } from '../shared/auth-google.interface';\n\n@Component({\n selector: 'igo-auth-google',\n templateUrl: './auth-google.component.html',\n styleUrls: ['./auth-google.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class AuthGoogleComponent {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private languageService = inject(LanguageService);\n private appRef = inject(ApplicationRef);\n\n private options?: AuthGoogleOptions;\n\n readonly login = output<boolean>();\n\n constructor() {\n this.options = this.config.getConfig('auth.google');\n\n if (this.options?.apiKey && this.options?.clientId) {\n this.loadSDKGoogle();\n this.loadPlatform();\n } else {\n console.warn(\n 'Google authentification needs \"apiKey\" and \"clientId\" options'\n );\n }\n }\n\n public handleSignInClick() {\n (window as any).gapi.auth2.getAuthInstance().signIn();\n }\n\n public handleSignOutClick() {\n (window as any).gapi.auth2.getAuthInstance().signOut();\n }\n\n private handleClientLoad() {\n (window as any).gapi.load('client:auth2', () => this.initClient());\n }\n\n private initClient() {\n (window as any).gapi.client\n .init({\n apiKey: this.options?.apiKey,\n clientId: this.options?.clientId,\n discoveryDocs: [\n 'https://people.googleapis.com/$discovery/rest?version=v1'\n ],\n scope: 'profile'\n })\n .then(() => {\n this.handleSignOutClick();\n this.updateTextButton();\n (window as any).gapi.auth2\n .getAuthInstance()\n .isSignedIn.listen((rep) => {\n this.updateSigninStatus(rep);\n });\n });\n }\n\n private updateSigninStatus(isSignedIn) {\n this.updateTextButton();\n if (isSignedIn) {\n this.loginGoogle((window as any).gapi.client.getToken().access_token);\n }\n }\n\n private updateTextButton() {\n const btn = document.querySelector('span[id^=\"not_signed_\"]');\n if (btn && this.languageService.getLanguage() !== 'en') {\n if (btn.innerHTML === 'Sign in with Google') {\n btn.innerHTML = this.languageService.translate.instant(\n 'igo.auth.google.login'\n );\n } else if (btn.innerHTML === 'Signed in with Google') {\n btn.innerHTML = this.languageService.translate.instant(\n 'igo.auth.google.logged'\n );\n }\n }\n }\n\n private loginGoogle(token) {\n this.authService.loginWithToken(token, 'google').subscribe(() => {\n this.appRef.tick();\n this.login.emit(true);\n });\n }\n\n private loadSDKGoogle() {\n const fjs = document.getElementsByTagName('script')[0];\n const js = document.createElement('script');\n js.id = 'google-jssdk';\n js.src = 'https://apis.google.com/js/api.js';\n js.onload = () => {\n this.handleClientLoad();\n };\n fjs.parentNode.insertBefore(js, fjs);\n }\n\n private loadPlatform() {\n const fjs = document.getElementsByTagName('script')[0];\n const js = document.createElement('script');\n js.id = 'google-platform';\n js.src = 'https://apis.google.com/js/platform.js';\n fjs.parentNode.insertBefore(js, fjs);\n }\n}\n","<div\n class=\"g-signin2 google-login-button\"\n data-height=\"40\"\n data-width=\"265\"\n data-longtitle=\"true\"\n></div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAqBa,mBAAmB,CAAA;AACtB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;AAC9B,IAAA,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;AACzC,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;AAE/B,IAAA,OAAO;IAEN,KAAK,GAAG,MAAM,EAAW;AAElC,IAAA,WAAA,GAAA;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC;AAEnD,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE;YAClD,IAAI,CAAC,aAAa,EAAE;YACpB,IAAI,CAAC,YAAY,EAAE;QACrB;aAAO;AACL,YAAA,OAAO,CAAC,IAAI,CACV,+DAA+D,CAChE;QACH;IACF;IAEO,iBAAiB,GAAA;QACrB,MAAc,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE;IACvD;IAEO,kBAAkB,GAAA;QACtB,MAAc,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE;IACxD;IAEQ,gBAAgB,GAAA;AACrB,QAAA,MAAc,CAA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AAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,wGCrBhC,mIAMA,EAAA,MAAA,EAAA,CAAA,qHAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDea,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAP/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,eAAA,EAGV,uBAAuB,CAAC,MAAM,cACnC,IAAI,EAAA,QAAA,EAAA,mIAAA,EAAA,MAAA,EAAA,CAAA,qHAAA,CAAA,EAAA;;;AEnBlB;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
2
|
+
import { inject, output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { UntypedFormBuilder, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import * as i4 from '@angular/material/button';
|
|
@@ -26,7 +26,7 @@ class AuthInternComponent {
|
|
|
26
26
|
error = '';
|
|
27
27
|
form;
|
|
28
28
|
loading = false;
|
|
29
|
-
login =
|
|
29
|
+
login = output();
|
|
30
30
|
constructor() {
|
|
31
31
|
const fb = inject(UntypedFormBuilder);
|
|
32
32
|
this.form = fb.group({
|
|
@@ -57,10 +57,10 @@ class AuthInternComponent {
|
|
|
57
57
|
this.login.emit(true);
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
61
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
60
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthInternComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
61
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.6", type: AuthInternComponent, isStandalone: true, selector: "igo-auth-intern", inputs: { allowAnonymous: "allowAnonymous" }, outputs: { login: "login" }, ngImport: i0, template: "<form [formGroup]=\"form\" role=\"form\" (ngSubmit)=\"loginUser(form.value)\">\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>{{ 'igo.auth.user' | translate }}</mat-label>\n <input\n matInput\n required\n placeholder=\"{{ 'igo.auth.user' | translate }}\"\n formControlName=\"username\"\n />\n </mat-form-field>\n </div>\n\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>{{ 'igo.auth.password' | translate }}</mat-label>\n <input\n matInput\n required\n type=\"password\"\n placeholder=\"{{ 'igo.auth.password' | translate }}\"\n formControlName=\"password\"\n />\n </mat-form-field>\n </div>\n\n <button matButton=\"elevated\" type=\"submit\">\n {{ 'igo.auth.login' | translate }}\n </button>\n @if (allowAnonymous) {\n <button\n matButton=\"elevated\"\n class=\"anonymous\"\n type=\"button\"\n (click)=\"loginAnonymous()\"\n >\n {{ 'igo.auth.accessAnonymous' | translate }}\n </button>\n }\n @if (error) {\n <div>\n <br />\n <font size=\"3\" color=\"red\">{{ error }}</font>\n </div>\n }\n</form>\n\n@if (loading) {\n <div class=\"loading-container\">\n <mat-spinner [diameter]=\"40\" />\n </div>\n}\n", styles: [".full-width{width:100%}.anonymous{margin-left:10px}.loading-container{position:absolute;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:1000;top:0;left:0;padding:24px;box-sizing:border-box}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.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: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
62
62
|
}
|
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthInternComponent, decorators: [{
|
|
64
64
|
type: Component,
|
|
65
65
|
args: [{ selector: 'igo-auth-intern', changeDetection: ChangeDetectionStrategy.Default, imports: [
|
|
66
66
|
FormsModule,
|
|
@@ -70,12 +70,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
70
70
|
MatButtonModule,
|
|
71
71
|
MatProgressSpinner,
|
|
72
72
|
IgoLanguageModule
|
|
73
|
-
], template: "<form [formGroup]=\"form\" role=\"form\" (ngSubmit)=\"loginUser(form.value)\">\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>{{ 'igo.auth.user' | translate }}</mat-label>\n <input\n matInput\n required\n placeholder=\"{{ 'igo.auth.user' | translate }}\"\n formControlName=\"username\"\n />\n </mat-form-field>\n </div>\n\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>{{ 'igo.auth.password' | translate }}</mat-label>\n <input\n matInput\n required\n type=\"password\"\n placeholder=\"{{ 'igo.auth.password' | translate }}\"\n formControlName=\"password\"\n />\n </mat-form-field>\n </div>\n\n <button matButton=\"elevated\" type=\"submit\">\n {{ 'igo.auth.login' | translate }}\n </button>\n @if (allowAnonymous) {\n <button\n matButton=\"elevated\"\n class=\"anonymous\"\n type=\"button\"\n (click)=\"loginAnonymous()\"\n >\n {{ 'igo.auth.accessAnonymous' | translate }}\n </button>\n }\n @if (error) {\n <div>\n <br />\n <font size=\"3\" color=\"red\">{{ error }}</font>\n </div>\n }\n</form>\n\n@if (loading) {\n <div class=\"loading-container\">\n <mat-spinner [diameter]=\"40\"
|
|
73
|
+
], template: "<form [formGroup]=\"form\" role=\"form\" (ngSubmit)=\"loginUser(form.value)\">\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>{{ 'igo.auth.user' | translate }}</mat-label>\n <input\n matInput\n required\n placeholder=\"{{ 'igo.auth.user' | translate }}\"\n formControlName=\"username\"\n />\n </mat-form-field>\n </div>\n\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>{{ 'igo.auth.password' | translate }}</mat-label>\n <input\n matInput\n required\n type=\"password\"\n placeholder=\"{{ 'igo.auth.password' | translate }}\"\n formControlName=\"password\"\n />\n </mat-form-field>\n </div>\n\n <button matButton=\"elevated\" type=\"submit\">\n {{ 'igo.auth.login' | translate }}\n </button>\n @if (allowAnonymous) {\n <button\n matButton=\"elevated\"\n class=\"anonymous\"\n type=\"button\"\n (click)=\"loginAnonymous()\"\n >\n {{ 'igo.auth.accessAnonymous' | translate }}\n </button>\n }\n @if (error) {\n <div>\n <br />\n <font size=\"3\" color=\"red\">{{ error }}</font>\n </div>\n }\n</form>\n\n@if (loading) {\n <div class=\"loading-container\">\n <mat-spinner [diameter]=\"40\" />\n </div>\n}\n", styles: [".full-width{width:100%}.anonymous{margin-left:10px}.loading-container{position:absolute;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:1000;top:0;left:0;padding:24px;box-sizing:border-box}\n"] }]
|
|
74
74
|
}], ctorParameters: () => [], propDecorators: { allowAnonymous: [{
|
|
75
75
|
type: Input
|
|
76
|
-
}], login: [{
|
|
77
|
-
type: Output
|
|
78
|
-
}] } });
|
|
76
|
+
}], login: [{ type: i0.Output, args: ["login"] }] } });
|
|
79
77
|
|
|
80
78
|
/**
|
|
81
79
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"igo2-auth-internal.mjs","sources":["../../../packages/auth/internal/src/auth-intern/auth-intern.component.ts","../../../packages/auth/internal/src/auth-intern/auth-intern.component.html","../../../packages/auth/internal/src/igo2-auth-internal.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n
|
|
1
|
+
{"version":3,"file":"igo2-auth-internal.mjs","sources":["../../../packages/auth/internal/src/auth-intern/auth-intern.component.ts","../../../packages/auth/internal/src/auth-intern/auth-intern.component.html","../../../packages/auth/internal/src/igo2-auth-internal.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n inject,\n output\n} from '@angular/core';\nimport {\n FormsModule,\n ReactiveFormsModule,\n UntypedFormBuilder,\n UntypedFormGroup,\n Validators\n} from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\n\nimport { AuthService } from '@igo2/auth';\nimport { LanguageService } from '@igo2/core/language';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\n@Component({\n selector: 'igo-auth-intern',\n templateUrl: './auth-intern.component.html',\n styleUrls: ['./auth-intern.component.scss'],\n changeDetection: ChangeDetectionStrategy.Default,\n imports: [\n FormsModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n MatInputModule,\n MatButtonModule,\n MatProgressSpinner,\n IgoLanguageModule\n ]\n})\nexport class AuthInternComponent {\n auth = inject(AuthService);\n private languageService = inject(LanguageService);\n\n @Input()\n get allowAnonymous(): boolean {\n return this._allowAnonymous;\n }\n set allowAnonymous(value: boolean) {\n this._allowAnonymous = value;\n }\n private _allowAnonymous = true;\n\n public error = '';\n public form: UntypedFormGroup;\n public loading = false;\n\n readonly login = output<boolean>();\n\n constructor() {\n const fb = inject(UntypedFormBuilder);\n\n this.form = fb.group({\n username: ['', Validators.required],\n password: ['', Validators.required]\n });\n }\n\n loginUser(values: any) {\n this.loading = true;\n this.auth.login(values.username, values.password).subscribe(\n () => {\n this.login.emit(true);\n this.loading = false;\n },\n (error: any) => {\n try {\n this.languageService.translate\n .get('igo.auth.error.' + error.error.message)\n .subscribe((errorMsg) => (this.error = errorMsg));\n } catch {\n this.error = error.error.message;\n }\n this.loading = false;\n }\n );\n return false;\n }\n\n loginAnonymous() {\n this.auth.loginAnonymous().subscribe(() => {\n this.login.emit(true);\n });\n }\n}\n","<form [formGroup]=\"form\" role=\"form\" (ngSubmit)=\"loginUser(form.value)\">\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>{{ 'igo.auth.user' | translate }}</mat-label>\n <input\n matInput\n required\n placeholder=\"{{ 'igo.auth.user' | translate }}\"\n formControlName=\"username\"\n />\n </mat-form-field>\n </div>\n\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>{{ 'igo.auth.password' | translate }}</mat-label>\n <input\n matInput\n required\n type=\"password\"\n placeholder=\"{{ 'igo.auth.password' | translate }}\"\n formControlName=\"password\"\n />\n </mat-form-field>\n </div>\n\n <button matButton=\"elevated\" type=\"submit\">\n {{ 'igo.auth.login' | translate }}\n </button>\n @if (allowAnonymous) {\n <button\n matButton=\"elevated\"\n class=\"anonymous\"\n type=\"button\"\n (click)=\"loginAnonymous()\"\n >\n {{ 'igo.auth.accessAnonymous' | translate }}\n </button>\n }\n @if (error) {\n <div>\n <br />\n <font size=\"3\" color=\"red\">{{ error }}</font>\n </div>\n }\n</form>\n\n@if (loading) {\n <div class=\"loading-container\">\n <mat-spinner [diameter]=\"40\" />\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAsCa,mBAAmB,CAAA;AAC9B,IAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;AAClB,IAAA,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;AAEjD,IAAA,IACI,cAAc,GAAA;QAChB,OAAO,IAAI,CAAC,eAAe;IAC7B;IACA,IAAI,cAAc,CAAC,KAAc,EAAA;AAC/B,QAAA,IAAI,CAAC,eAAe,GAAG,KAAK;IAC9B;IACQ,eAAe,GAAG,IAAI;IAEvB,KAAK,GAAG,EAAE;AACV,IAAA,IAAI;IACJ,OAAO,GAAG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AAA,EAAA,wxCAAA,EAAA,MAAA,EAAA,CAAA,uOAAA,CAAA,EAAA;;sBAMA;;;AE1CH;;AAEG;;;;"}
|
|
@@ -3,7 +3,7 @@ import { ConfigService } from '@igo2/core/config';
|
|
|
3
3
|
import { MsalService, MSAL_GUARD_CONFIG, MsalBroadcastService, MSAL_INSTANCE } from '@azure/msal-angular';
|
|
4
4
|
import { PublicClientApplication, InteractionStatus, InteractionRequiredAuthError, WrapperSKU, EventMessageUtils, InteractionType } from '@azure/msal-browser';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { inject, ApplicationRef,
|
|
6
|
+
import { inject, ApplicationRef, output, ChangeDetectionStrategy, Component, Injectable } from '@angular/core';
|
|
7
7
|
import * as i1 from '@angular/material/button';
|
|
8
8
|
import { MatButtonModule } from '@angular/material/button';
|
|
9
9
|
import { MICROSOFT_ICON, IgoIconComponent } from '@igo2/common/icon';
|
|
@@ -21,7 +21,7 @@ class AuthMicrosoftComponent {
|
|
|
21
21
|
msalGuardConfig = inject(MSAL_GUARD_CONFIG);
|
|
22
22
|
options;
|
|
23
23
|
_destroying$ = new Subject();
|
|
24
|
-
login =
|
|
24
|
+
login = output();
|
|
25
25
|
broadcastService;
|
|
26
26
|
svgIcon = MICROSOFT_ICON;
|
|
27
27
|
constructor() {
|
|
@@ -79,15 +79,13 @@ class AuthMicrosoftComponent {
|
|
|
79
79
|
getConf() {
|
|
80
80
|
return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];
|
|
81
81
|
}
|
|
82
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
83
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
82
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMicrosoftComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
83
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", 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\" />\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 });
|
|
84
84
|
}
|
|
85
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
85
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMicrosoftComponent, decorators: [{
|
|
86
86
|
type: Component,
|
|
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\"
|
|
88
|
-
}], ctorParameters: () => [], propDecorators: { login: [{
|
|
89
|
-
type: Output
|
|
90
|
-
}] } });
|
|
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\" />\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: [{ type: i0.Output, args: ["login"] }] } });
|
|
91
89
|
|
|
92
90
|
/*
|
|
93
91
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -155,10 +153,10 @@ class MsalServiceb2c {
|
|
|
155
153
|
this.logger = logger.clone(this.name, this.version);
|
|
156
154
|
this.instance.setLogger(logger);
|
|
157
155
|
}
|
|
158
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
159
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
156
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MsalServiceb2c, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
157
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MsalServiceb2c });
|
|
160
158
|
}
|
|
161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MsalServiceb2c, decorators: [{
|
|
162
160
|
type: Injectable
|
|
163
161
|
}], ctorParameters: () => [] });
|
|
164
162
|
|
|
@@ -190,10 +188,10 @@ class MsalBroadcastServiceb2c {
|
|
|
190
188
|
}
|
|
191
189
|
});
|
|
192
190
|
}
|
|
193
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
194
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
191
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MsalBroadcastServiceb2c, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
192
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MsalBroadcastServiceb2c });
|
|
195
193
|
}
|
|
196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
194
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MsalBroadcastServiceb2c, decorators: [{
|
|
197
195
|
type: Injectable
|
|
198
196
|
}], ctorParameters: () => [] });
|
|
199
197
|
|
|
@@ -205,7 +203,7 @@ class AuthMicrosoftb2cComponent {
|
|
|
205
203
|
msalGuardConfig = inject(MSAL_GUARD_CONFIG);
|
|
206
204
|
options;
|
|
207
205
|
_destroying$ = new Subject();
|
|
208
|
-
login =
|
|
206
|
+
login = output();
|
|
209
207
|
broadcastService;
|
|
210
208
|
svgIcon = MICROSOFT_ICON;
|
|
211
209
|
constructor() {
|
|
@@ -259,15 +257,13 @@ class AuthMicrosoftb2cComponent {
|
|
|
259
257
|
getConf() {
|
|
260
258
|
return this.msalGuardConfig.filter((conf) => conf.type === 'b2c')[0];
|
|
261
259
|
}
|
|
262
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
263
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
260
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMicrosoftb2cComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
261
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", 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\" />\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 });
|
|
264
262
|
}
|
|
265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
263
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMicrosoftb2cComponent, decorators: [{
|
|
266
264
|
type: Component,
|
|
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\"
|
|
268
|
-
}], ctorParameters: () => [], propDecorators: { login: [{
|
|
269
|
-
type: Output
|
|
270
|
-
}] } });
|
|
265
|
+
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\" />\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"] }]
|
|
266
|
+
}], ctorParameters: () => [], propDecorators: { login: [{ type: i0.Output, args: ["login"] }] } });
|
|
271
267
|
|
|
272
268
|
const AUTH_MICROSOFT_DIRECTIVES = [
|
|
273
269
|
AuthMicrosoftComponent,
|
|
@@ -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 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,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;AAC9B,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/B,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,C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AAE;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
|
+
{"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 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 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 readonly login = output<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\" />\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 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 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 readonly login = output<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\" />\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\n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7B,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;;;;"}
|
|
@@ -34,10 +34,10 @@ class AuthMonitoringService {
|
|
|
34
34
|
break;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
38
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
37
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMonitoringService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
38
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
|
|
39
39
|
}
|
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMonitoringService, decorators: [{
|
|
41
41
|
type: Injectable,
|
|
42
42
|
args: [{
|
|
43
43
|
providedIn: 'root'
|
package/fesm2022/igo2-auth.mjs
CHANGED
|
@@ -46,10 +46,10 @@ class TokenService {
|
|
|
46
46
|
}
|
|
47
47
|
return true;
|
|
48
48
|
}
|
|
49
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
50
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
49
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TokenService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
50
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TokenService, providedIn: 'root' });
|
|
51
51
|
}
|
|
52
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TokenService, decorators: [{
|
|
53
53
|
type: Injectable,
|
|
54
54
|
args: [{
|
|
55
55
|
providedIn: 'root'
|
|
@@ -195,10 +195,10 @@ class AuthService {
|
|
|
195
195
|
throw err;
|
|
196
196
|
}));
|
|
197
197
|
}
|
|
198
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
199
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
198
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
199
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthService, providedIn: 'root' });
|
|
200
200
|
}
|
|
201
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
201
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthService, decorators: [{
|
|
202
202
|
type: Injectable,
|
|
203
203
|
args: [{
|
|
204
204
|
providedIn: 'root'
|
|
@@ -282,10 +282,10 @@ class AuthStorageService extends BaseStorage {
|
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
286
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
285
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
286
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthStorageService, providedIn: 'root' });
|
|
287
287
|
}
|
|
288
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthStorageService, decorators: [{
|
|
289
289
|
type: Injectable,
|
|
290
290
|
args: [{
|
|
291
291
|
providedIn: 'root'
|
|
@@ -434,10 +434,10 @@ class AuthInterceptor {
|
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
438
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
437
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
438
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthInterceptor, providedIn: 'root' });
|
|
439
439
|
}
|
|
440
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthInterceptor, decorators: [{
|
|
441
441
|
type: Injectable,
|
|
442
442
|
args: [{
|
|
443
443
|
providedIn: 'root'
|
|
@@ -459,10 +459,10 @@ class LoggedGuard {
|
|
|
459
459
|
}
|
|
460
460
|
return false;
|
|
461
461
|
}
|
|
462
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
463
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
462
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: LoggedGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
463
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: LoggedGuard, providedIn: 'root' });
|
|
464
464
|
}
|
|
465
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
465
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: LoggedGuard, decorators: [{
|
|
466
466
|
type: Injectable,
|
|
467
467
|
args: [{
|
|
468
468
|
providedIn: 'root'
|
|
@@ -484,10 +484,10 @@ class AuthGuard {
|
|
|
484
484
|
}
|
|
485
485
|
return false;
|
|
486
486
|
}
|
|
487
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
488
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
487
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
488
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthGuard, providedIn: 'root' });
|
|
489
489
|
}
|
|
490
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
490
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthGuard, decorators: [{
|
|
491
491
|
type: Injectable,
|
|
492
492
|
args: [{
|
|
493
493
|
providedIn: 'root'
|
|
@@ -509,10 +509,10 @@ class AdminGuard {
|
|
|
509
509
|
}
|
|
510
510
|
return false;
|
|
511
511
|
}
|
|
512
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
513
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
512
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AdminGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
513
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AdminGuard, providedIn: 'root' });
|
|
514
514
|
}
|
|
515
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
515
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AdminGuard, decorators: [{
|
|
516
516
|
type: Injectable,
|
|
517
517
|
args: [{
|
|
518
518
|
providedIn: 'root'
|
|
@@ -538,10 +538,10 @@ class ProfilsGuard {
|
|
|
538
538
|
return false;
|
|
539
539
|
}));
|
|
540
540
|
}
|
|
541
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
542
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
541
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: ProfilsGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
542
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: ProfilsGuard, providedIn: 'root' });
|
|
543
543
|
}
|
|
544
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
544
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: ProfilsGuard, decorators: [{
|
|
545
545
|
type: Injectable,
|
|
546
546
|
args: [{
|
|
547
547
|
providedIn: 'root'
|
package/form/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { AuthGoogleOptions } from '@igo2/auth/google';
|
|
|
5
5
|
import * as i14 from '@igo2/auth/microsoft';
|
|
6
6
|
import { AuthMicrosoftOptions, AuthMicrosoftb2cOptions } from '@igo2/auth/microsoft';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { OnInit
|
|
8
|
+
import { OnInit } from '@angular/core';
|
|
9
9
|
import * as i1 from '@angular/common';
|
|
10
10
|
import * as i2 from '@angular/forms';
|
|
11
11
|
import * as i3 from '@angular/material/form-field';
|
|
@@ -45,7 +45,7 @@ declare class AuthFormComponent implements OnInit {
|
|
|
45
45
|
set showLogoutDiv(value: boolean);
|
|
46
46
|
private _showLogoutDiv;
|
|
47
47
|
get showLoginDiv(): boolean;
|
|
48
|
-
login:
|
|
48
|
+
readonly login: i0.OutputEmitterRef<boolean>;
|
|
49
49
|
options?: AuthOptions & AuthFormOptions;
|
|
50
50
|
user: any;
|
|
51
51
|
visible: boolean;
|
package/google/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter } from '@angular/core';
|
|
3
2
|
|
|
4
3
|
declare class AuthGoogleComponent {
|
|
5
4
|
private authService;
|
|
@@ -7,7 +6,7 @@ declare class AuthGoogleComponent {
|
|
|
7
6
|
private languageService;
|
|
8
7
|
private appRef;
|
|
9
8
|
private options?;
|
|
10
|
-
login:
|
|
9
|
+
readonly login: i0.OutputEmitterRef<boolean>;
|
|
11
10
|
constructor();
|
|
12
11
|
handleSignInClick(): void;
|
|
13
12
|
handleSignOutClick(): void;
|
package/internal/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter } from '@angular/core';
|
|
3
2
|
import { UntypedFormGroup } from '@angular/forms';
|
|
4
3
|
import { AuthService } from '@igo2/auth';
|
|
5
4
|
|
|
@@ -12,7 +11,7 @@ declare class AuthInternComponent {
|
|
|
12
11
|
error: string;
|
|
13
12
|
form: UntypedFormGroup;
|
|
14
13
|
loading: boolean;
|
|
15
|
-
login:
|
|
14
|
+
readonly login: i0.OutputEmitterRef<boolean>;
|
|
16
15
|
constructor();
|
|
17
16
|
loginUser(values: any): boolean;
|
|
18
17
|
loginAnonymous(): void;
|
package/microsoft/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { AuthFeature, AuthFeatureKind } from '@igo2/auth';
|
|
|
2
2
|
import { ConfigService } from '@igo2/core/config';
|
|
3
3
|
import { BrowserAuthOptions, PublicClientApplication } from '@azure/msal-browser';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { EventEmitter } from '@angular/core';
|
|
6
5
|
import { IconSvg } from '@igo2/common/icon';
|
|
7
6
|
import { MsalGuardConfiguration } from '@azure/msal-angular';
|
|
8
7
|
|
|
@@ -14,7 +13,7 @@ declare class AuthMicrosoftComponent {
|
|
|
14
13
|
private msalGuardConfig;
|
|
15
14
|
private options?;
|
|
16
15
|
private readonly _destroying$;
|
|
17
|
-
login:
|
|
16
|
+
readonly login: i0.OutputEmitterRef<boolean>;
|
|
18
17
|
private broadcastService;
|
|
19
18
|
svgIcon: IconSvg;
|
|
20
19
|
constructor();
|
|
@@ -33,7 +32,7 @@ declare class AuthMicrosoftb2cComponent {
|
|
|
33
32
|
private msalGuardConfig;
|
|
34
33
|
private options;
|
|
35
34
|
private readonly _destroying$;
|
|
36
|
-
login:
|
|
35
|
+
readonly login: i0.OutputEmitterRef<boolean>;
|
|
37
36
|
private broadcastService;
|
|
38
37
|
svgIcon: IconSvg;
|
|
39
38
|
constructor();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@igo2/auth",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.1.0-next.1",
|
|
4
4
|
"description": "IGO Library",
|
|
5
5
|
"author": "IGO Community",
|
|
6
6
|
"keywords": [
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"@angular/router": "^20.0.0",
|
|
65
65
|
"@azure/msal-angular": "^4.0.0",
|
|
66
66
|
"@azure/msal-browser": "^4.0.0",
|
|
67
|
-
"@igo2/common": "^20.0.
|
|
68
|
-
"@igo2/core": "^20.0.
|
|
69
|
-
"@igo2/utils": "^20.0.
|
|
67
|
+
"@igo2/common": "^20.1.0-next.1",
|
|
68
|
+
"@igo2/core": "^20.1.0-next.1",
|
|
69
|
+
"@igo2/utils": "^20.1.0-next.1",
|
|
70
70
|
"jwt-decode": "^4.0.0",
|
|
71
71
|
"rxjs": "^7.8.0",
|
|
72
72
|
"ts-cacheable": "^1.0.6",
|