@igo2/auth 20.1.0-next.2 → 20.1.0-next.20

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.
@@ -49,10 +49,10 @@ 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.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 });
52
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthFacebookComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
53
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", 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.6", ngImport: i0, type: AuthFacebookComponent, decorators: [{
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", 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
58
  }], ctorParameters: () => [], propDecorators: { login: [{ type: i0.Output, args: ["login"] }] } });
@@ -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 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;aAAO;AACL,YAAA,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC;QAChE;IACF;IAEQ,eAAe,GAAA;AACpB,QAAA,MAAc,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC,GAAG,KAAI;AAC9D,YAAA,IAAI,C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AAA,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
+ {"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;aAAO;AACL,YAAA,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC;QAChE;IACF;IAEQ,eAAe,GAAA;AACpB,QAAA,MAAc,CAAC,EAAE,CAAC,KA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,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,SAAA,EAAA,IAAA,EAAA,qBAAqB,0GCpBlC,iOASA,EAAA,MAAA,EAAA,CAAA,mFAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDWa,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;;;;"}
@@ -92,17 +92,16 @@ class AuthFormComponent {
92
92
  this.login.emit(true);
93
93
  }
94
94
  logout() {
95
- this.auth.logout().subscribe(() => {
96
- this.user = undefined;
97
- if (this.router) {
98
- if (this.options?.logoutRoute) {
99
- this.router.navigate([this.options?.logoutRoute]);
100
- }
101
- else if (this.options?.homeRoute) {
102
- this.router.navigate([this.options?.homeRoute]);
103
- }
95
+ this.auth.logout();
96
+ this.user = undefined;
97
+ if (this.router) {
98
+ if (this.options?.logoutRoute) {
99
+ this.router.navigate([this.options?.logoutRoute]);
104
100
  }
105
- });
101
+ else if (this.options?.homeRoute) {
102
+ this.router.navigate([this.options?.homeRoute]);
103
+ }
104
+ }
106
105
  }
107
106
  home() {
108
107
  if (this.router && this.options?.homeRoute) {
@@ -134,10 +133,10 @@ class AuthFormComponent {
134
133
  }
135
134
  });
136
135
  }
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 });
136
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
137
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", 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
138
  }
140
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthFormComponent, decorators: [{
139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthFormComponent, decorators: [{
141
140
  type: Component,
142
141
  args: [{ selector: 'igo-auth-form', changeDetection: ChangeDetectionStrategy.Default, imports: [
143
142
  AuthGoogleComponent,
@@ -161,8 +160,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImpor
161
160
  }], login: [{ type: i0.Output, args: ["login"] }] } });
162
161
 
163
162
  class IgoAuthFormModule {
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,
163
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: IgoAuthFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
164
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: IgoAuthFormModule, imports: [CommonModule,
166
165
  ReactiveFormsModule,
167
166
  MatFormFieldModule,
168
167
  MatInputModule,
@@ -177,7 +176,7 @@ class IgoAuthFormModule {
177
176
  AuthFacebookComponent,
178
177
  AuthMicrosoftComponent,
179
178
  AuthMicrosoftb2cComponent], exports: [AuthFormComponent] });
180
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoAuthFormModule, imports: [CommonModule,
179
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: IgoAuthFormModule, imports: [CommonModule,
181
180
  ReactiveFormsModule,
182
181
  MatFormFieldModule,
183
182
  MatInputModule,
@@ -193,7 +192,7 @@ class IgoAuthFormModule {
193
192
  AuthMicrosoftComponent,
194
193
  AuthMicrosoftb2cComponent] });
195
194
  }
196
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: IgoAuthFormModule, decorators: [{
195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: IgoAuthFormModule, decorators: [{
197
196
  type: NgModule,
198
197
  args: [{
199
198
  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 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,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,GAAA;AACzB,QAAA,IAAI,IAAI,CAAC,aAAa,EA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AsB;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();\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 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,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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e;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,SAAA,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;;4FAIhB,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;;;;"}
@@ -90,10 +90,10 @@ 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.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 });
93
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthGoogleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
94
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", 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.6", ngImport: i0, type: AuthGoogleComponent, decorators: [{
96
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", 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
99
  }], ctorParameters: () => [], propDecorators: { login: [{ type: i0.Output, args: ["login"] }] } });
@@ -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 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,a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AAC,CAAC,CAAC;QACtD,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;AAC3C,QAAA,EAAE,CAAC,EAAE,GAAG,iBAAiB;AACzB,QAAA,EAAE,CAAC,GAAG,GAAG,wCAAwC;QACjD,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,EAAE,GAAG,CAAC;IACtC;uGAtGW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAnB,IAAA,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
+ {"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;AAC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AAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,mBAAmB,wGCrBhC,mIAMA,EAAA,MAAA,EAAA,CAAA,qHAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDea,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;;;;"}
@@ -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.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 });
60
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthInternComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
61
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", 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.6", ngImport: i0, type: AuthInternComponent, decorators: [{
63
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthInternComponent, decorators: [{
64
64
  type: Component,
65
65
  args: [{ selector: 'igo-auth-intern', changeDetection: ChangeDetectionStrategy.Default, imports: [
66
66
  FormsModule,
@@ -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 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,KAAK;IAEb,KAAK,GAAG,MAAM,EAAW;AAElC,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,EAAE,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAErC,QAAA,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC;AACnB,YAAA,QAAQ,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AA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,QAAA,EAAA,QAAA,EAAA,yHAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,IAAA,EAAA,aAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,mBAAA,EAAA,kBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,qBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACd,eAAe,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,iOAAA,EAAA,MAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACf,kBAAkB,8KAClB,iBAAiB,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,OAAA,EAAA,CAAA;;2FAGR,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAf/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,eAAA,EAGV,uBAAuB,CAAC,OAAO,EAAA,OAAA,EACvC;wBACP,WAAW;wBACX,mBAAmB;wBACnB,kBAAkB;wBAClB,cAAc;wBACd,eAAe;wBACf,kBAAkB;wBAClB;AACD,qBAAA,EAAA,QAAA,EAAA,wxCAAA,EAAA,MAAA,EAAA,CAAA,uOAAA,CAAA,EAAA;;sBAMA;;;AE1CH;;AAEG;;;;"}
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,KAAK;IAEb,KAAK,GAAG,MAAM,EAAW;AAElC,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,EAAE,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAErC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