@igo2/auth 21.0.0-next.2 → 21.0.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.
@@ -8,8 +8,6 @@ import { MatFormFieldModule } from '@angular/material/form-field';
8
8
  import { MatIconModule } from '@angular/material/icon';
9
9
  import { MatInputModule } from '@angular/material/input';
10
10
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
11
- import { AuthFacebookComponent } from '@igo2/auth/facebook';
12
- import { AuthGoogleComponent } from '@igo2/auth/google';
13
11
  import { AuthInternComponent } from '@igo2/auth/internal';
14
12
  import { AuthMicrosoftComponent, AuthMicrosoftb2cComponent } from '@igo2/auth/microsoft';
15
13
  import { IgoLanguageModule } from '@igo2/core/language';
@@ -69,12 +67,11 @@ class AuthFormComponent {
69
67
  }
70
68
  _showLogoutDiv = false;
71
69
  get showLoginDiv() {
72
- if (!this.isLogoutRoute) {
73
- return true;
74
- }
70
+ return !this.isLogoutRoute ? true : false;
75
71
  }
76
72
  login = output();
77
73
  options;
74
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
78
75
  user;
79
76
  visible = true;
80
77
  isLogoutRoute;
@@ -133,20 +130,18 @@ class AuthFormComponent {
133
130
  }
134
131
  });
135
132
  }
136
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
137
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", 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.Eager });
133
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
134
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", 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?.microsoft && options?.microsoft?.enabled !== false) {\n <igo-auth-microsoft (login)=\"onLogin()\" />\n }\n @if (\n options?.microsoftb2c && options?.microsoftb2c?.enabled !== false\n ) {\n <igo-auth-microsoftb2c (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: AuthMicrosoftComponent, selector: "igo-auth-microsoft", outputs: ["login"] }, { kind: "component", type: AuthMicrosoftb2cComponent, selector: "igo-auth-microsoftb2c", 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.Eager });
138
135
  }
139
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthFormComponent, decorators: [{
136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthFormComponent, decorators: [{
140
137
  type: Component,
141
138
  args: [{ selector: 'igo-auth-form', changeDetection: ChangeDetectionStrategy.Default, imports: [
142
- AuthGoogleComponent,
143
139
  AuthMicrosoftComponent,
144
140
  AuthMicrosoftb2cComponent,
145
- AuthFacebookComponent,
146
141
  AuthInternComponent,
147
142
  MatButtonModule,
148
143
  IgoLanguageModule
149
- ], 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"] }]
144
+ ], 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?.microsoft && options?.microsoft?.enabled !== false) {\n <igo-auth-microsoft (login)=\"onLogin()\" />\n }\n @if (\n options?.microsoftb2c && options?.microsoftb2c?.enabled !== false\n ) {\n <igo-auth-microsoftb2c (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"] }]
150
145
  }], ctorParameters: () => [], propDecorators: { backgroundDisable: [{
151
146
  type: Input
152
147
  }], hasAlreadyConnectedDiv: [{
@@ -160,8 +155,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
160
155
  }], login: [{ type: i0.Output, args: ["login"] }] } });
161
156
 
162
157
  class IgoAuthFormModule {
163
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoAuthFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
164
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.10", ngImport: i0, type: IgoAuthFormModule, imports: [CommonModule,
158
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: IgoAuthFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
159
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.19", ngImport: i0, type: IgoAuthFormModule, imports: [CommonModule,
165
160
  ReactiveFormsModule,
166
161
  MatFormFieldModule,
167
162
  MatInputModule,
@@ -171,12 +166,10 @@ class IgoAuthFormModule {
171
166
  IgoLanguageModule,
172
167
  MsalModule,
173
168
  AuthFormComponent,
174
- AuthGoogleComponent,
175
169
  AuthInternComponent,
176
- AuthFacebookComponent,
177
170
  AuthMicrosoftComponent,
178
171
  AuthMicrosoftb2cComponent], exports: [AuthFormComponent] });
179
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoAuthFormModule, imports: [CommonModule,
172
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: IgoAuthFormModule, imports: [CommonModule,
180
173
  ReactiveFormsModule,
181
174
  MatFormFieldModule,
182
175
  MatInputModule,
@@ -186,13 +179,11 @@ class IgoAuthFormModule {
186
179
  IgoLanguageModule,
187
180
  MsalModule,
188
181
  AuthFormComponent,
189
- AuthGoogleComponent,
190
182
  AuthInternComponent,
191
- AuthFacebookComponent,
192
183
  AuthMicrosoftComponent,
193
184
  AuthMicrosoftb2cComponent] });
194
185
  }
195
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: IgoAuthFormModule, decorators: [{
186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: IgoAuthFormModule, decorators: [{
196
187
  type: NgModule,
197
188
  args: [{
198
189
  imports: [
@@ -206,9 +197,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
206
197
  IgoLanguageModule,
207
198
  MsalModule,
208
199
  AuthFormComponent,
209
- AuthGoogleComponent,
210
200
  AuthInternComponent,
211
- AuthFacebookComponent,
212
201
  AuthMicrosoftComponent,
213
202
  AuthMicrosoftb2cComponent
214
203
  ],
@@ -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();\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,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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;;;;"}
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 { 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 AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent,\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 return !this.isLogoutRoute ? true : false;\n }\n\n readonly login = output<boolean>();\n\n public options?: AuthOptions & AuthFormOptions;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public user: any;\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?.microsoft && options?.microsoft?.enabled !== false) {\n <igo-auth-microsoft (login)=\"onLogin()\" />\n }\n @if (\n options?.microsoftb2c && options?.microsoftb2c?.enabled !== false\n ) {\n <igo-auth-microsoftb2c (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 { 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 AuthInternComponent,\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":";;;;;;;;;;;;;;;;;;;;MAqCa,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,I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BACxB,eAAe;wBACf,iBAAiB;wBACjB,UAAU;wBACV,iBAAiB;wBACjB,mBAAmB;wBACnB,sBAAsB;wBACtB;AACD,qBAAA;oBACD,OAAO,EAAE,CAAC,iBAAiB;AAC5B,iBAAA;;;ACrCD;;AAEG;;ACFH;;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: "21.2.10", ngImport: i0, type: AuthInternComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
61
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", 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],[formArray],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.Eager });
60
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthInternComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
61
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", 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],[formArray],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.Eager });
62
62
  }
63
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthInternComponent, decorators: [{
63
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthInternComponent, decorators: [{
64
64
  type: Component,
65
65
  args: [{ selector: 'igo-auth-intern', changeDetection: ChangeDetectionStrategy.Default, imports: [
66
66
  FormsModule,
@@ -40,10 +40,10 @@ class AuthMicrosoftComponent {
40
40
  }
41
41
  });
42
42
  }
43
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthMicrosoftComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
44
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: AuthMicrosoftComponent, isStandalone: true, selector: "igo-auth-microsoft", outputs: { login: "login" }, ngImport: i0, template: "<button class=\"microsoft-login-button\" matButton=\"filled\" (click)=\"loginUser()\">\n <mat-icon\n ><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>Microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n@if (error) {\n <mat-error>{{ error }}</mat-error>\n}\n", styles: [":host{padding:12px 0 0;display:flex;flex-direction:column;gap:16px}mat-icon{margin-right:8px}.auth-microsoft-btn-content{display:flex;align-items:center}\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: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
43
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthMicrosoftComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
44
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: AuthMicrosoftComponent, isStandalone: true, selector: "igo-auth-microsoft", outputs: { login: "login" }, ngImport: i0, template: "<button class=\"microsoft-login-button\" matButton=\"filled\" (click)=\"loginUser()\">\n <mat-icon\n ><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>Microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n@if (error) {\n <mat-error>{{ error }}</mat-error>\n}\n", styles: [":host{padding:12px 0 0;display:flex;flex-direction:column;gap:16px}mat-icon{margin-right:8px}.auth-microsoft-btn-content{display:flex;align-items:center}\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: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
45
45
  }
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthMicrosoftComponent, decorators: [{
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthMicrosoftComponent, decorators: [{
47
47
  type: Component,
48
48
  args: [{ selector: 'igo-auth-microsoft', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, MatError, MatIconModule, IgoLanguageModule], template: "<button class=\"microsoft-login-button\" matButton=\"filled\" (click)=\"loginUser()\">\n <mat-icon\n ><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>Microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n@if (error) {\n <mat-error>{{ error }}</mat-error>\n}\n", styles: [":host{padding:12px 0 0;display:flex;flex-direction:column;gap:16px}mat-icon{margin-right:8px}.auth-microsoft-btn-content{display:flex;align-items:center}\n"] }]
49
49
  }], propDecorators: { login: [{ type: i0.Output, args: ["login"] }] } });
@@ -123,10 +123,10 @@ class MsalServiceb2c {
123
123
  this.logger = logger.clone(this.name, this.version);
124
124
  this.instance.setLogger(logger);
125
125
  }
126
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: MsalServiceb2c, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
127
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: MsalServiceb2c });
126
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: MsalServiceb2c, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
127
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: MsalServiceb2c });
128
128
  }
129
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: MsalServiceb2c, decorators: [{
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: MsalServiceb2c, decorators: [{
130
130
  type: Injectable
131
131
  }], ctorParameters: () => [] });
132
132
 
@@ -158,10 +158,10 @@ class MsalBroadcastServiceb2c {
158
158
  }
159
159
  });
160
160
  }
161
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: MsalBroadcastServiceb2c, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
162
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: MsalBroadcastServiceb2c });
161
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: MsalBroadcastServiceb2c, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
162
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: MsalBroadcastServiceb2c });
163
163
  }
164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: MsalBroadcastServiceb2c, decorators: [{
164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: MsalBroadcastServiceb2c, decorators: [{
165
165
  type: Injectable
166
166
  }], ctorParameters: () => [] });
167
167
 
@@ -176,7 +176,7 @@ class AuthMicrosoftb2cComponent {
176
176
  login = output();
177
177
  broadcastService;
178
178
  constructor() {
179
- this.options = this.config.getConfig('auth.microsoftb2c') || {};
179
+ this.options = this.config.getConfig('auth.microsoftb2c');
180
180
  this.msalService.instance = new PublicClientApplication({
181
181
  auth: this.options.browserAuthOptions,
182
182
  cache: {
@@ -226,10 +226,10 @@ class AuthMicrosoftb2cComponent {
226
226
  getConf() {
227
227
  return this.msalGuardConfig.filter((conf) => conf.type === 'b2c')[0];
228
228
  }
229
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthMicrosoftb2cComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
230
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.10", 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 <mat-icon>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}mat-icon{margin-right:12px}\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: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
229
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthMicrosoftb2cComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
230
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.19", 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 <mat-icon>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}mat-icon{margin-right:12px}\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: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
231
231
  }
232
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthMicrosoftb2cComponent, decorators: [{
232
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthMicrosoftb2cComponent, decorators: [{
233
233
  type: Component,
234
234
  args: [{ selector: 'igo-auth-microsoftb2c', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, IgoLanguageModule, MatIconModule], providers: [MsalServiceb2c], template: "<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoftb2c()\"\n>\n <mat-icon>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}mat-icon{margin-right:12px}\n"] }]
235
235
  }], ctorParameters: () => [], propDecorators: { login: [{ type: i0.Output, args: ["login"] }] } });
@@ -264,10 +264,10 @@ class AuthMsalService extends AuthService {
264
264
  getConf() {
265
265
  return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];
266
266
  }
267
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthMsalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
268
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthMsalService, providedIn: 'root' });
267
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthMsalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
268
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthMsalService, providedIn: 'root' });
269
269
  }
270
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthMsalService, decorators: [{
270
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthMsalService, decorators: [{
271
271
  type: Injectable,
272
272
  args: [{
273
273
  providedIn: 'root'
@@ -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/shared/auth-msal.service.ts","../../../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 OnInit,\n inject,\n output\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatError } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { AuthService } from '@igo2/auth';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { AuthMsalService } from '../shared/auth-msal.service';\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, MatError, MatIconModule, IgoLanguageModule]\n})\nexport class AuthMicrosoftComponent implements OnInit {\n private auth = inject(AuthService) as AuthMsalService;\n private appRef = inject(ApplicationRef);\n\n readonly login = output<boolean>();\n\n error = '';\n\n ngOnInit(): void {\n if (this.auth.autoLogin) {\n this.loginUser();\n }\n }\n\n public loginUser() {\n this.auth.login().subscribe({\n next: () => {\n this.appRef.tick();\n this.login.emit(true);\n },\n error: (err) => {\n this.auth\n .translateError('igo.auth.error.microsoft.', err)\n .subscribe((translatedErrorMsg) => {\n this.error = translatedErrorMsg;\n });\n }\n });\n }\n}\n","<button class=\"microsoft-login-button\" matButton=\"filled\" (click)=\"loginUser()\">\n <mat-icon\n ><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>Microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n@if (error) {\n <mat-error>{{ error }}</mat-error>\n}\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 HandleRedirectPromiseOptions,\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\n handleRedirectObservable(\n hashOrOptions?: string | HandleRedirectPromiseOptions\n ): Observable<AuthenticationResult | null> {\n let finalOptions: HandleRedirectPromiseOptions = {\n hash: this.redirectHash\n };\n\n if (typeof hashOrOptions === 'string') {\n finalOptions.hash = hashOrOptions;\n } else if (hashOrOptions) {\n finalOptions = { ...finalOptions, ...hashOrOptions };\n }\n\n return from(this.instance.handleRedirectPromise(finalOptions));\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.logoutPopup(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 message.correlationId\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';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { AuthService } from '@igo2/auth';\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 MsalGuardConfigurationWithType\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, MatIconModule],\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<MsalGuardConfigurationWithType[]>(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 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(): MsalGuardConfigurationWithType {\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 <mat-icon>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n","import { Injectable, inject } from '@angular/core';\n\nimport { AuthOptions, AuthService, IUser } from '@igo2/auth';\n\nimport { MSAL_GUARD_CONFIG, MsalService } from '@azure/msal-angular';\nimport { PopupRequest } from '@azure/msal-browser';\nimport { Observable, finalize, switchMap, tap } from 'rxjs';\n\nimport {\n AuthMicrosoftOptions,\n MsalGuardConfigurationWithType\n} from './auth-microsoft.interface';\n\ninterface IAuthMsalOptions extends AuthOptions {\n microsoft: AuthMicrosoftOptions;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthMsalService extends AuthService<IAuthMsalOptions> {\n private msalService = inject(MsalService);\n private msalGuardConfig =\n inject<MsalGuardConfigurationWithType[]>(MSAL_GUARD_CONFIG);\n\n private _isInitialized$: Observable<void>;\n autoLogin = false;\n\n constructor() {\n super();\n\n this.autoLogin = this.authOptions.microsoft?.autoLogin === true;\n this._isInitialized$ = this.msalService.initialize();\n }\n\n login(): Observable<IUser> {\n this.isLogging.set(true);\n return this._isInitialized$.pipe(\n switchMap(() =>\n this.msalService.loginPopup(this.getConf().authRequest as PopupRequest)\n ),\n tap(({ account }) => this.msalService.instance.setActiveAccount(account)),\n switchMap(({ idToken, accessToken }) =>\n this.loginWithToken(\n accessToken,\n 'microsoft',\n { tokenId: idToken },\n this.authOptions.microsoft.applicationId\n )\n ),\n finalize(() => this.isLogging.set(false))\n );\n }\n\n logout(): void {\n if (this.msalService?.instance?.getActiveAccount()) {\n const logoutRequest = {\n account: this.msalService.instance.getActiveAccount()\n };\n this._isInitialized$\n .pipe(switchMap(() => this.msalService.logoutPopup(logoutRequest)))\n .subscribe(() => super.logout());\n } else {\n super.logout();\n }\n }\n\n private getConf(): MsalGuardConfigurationWithType {\n return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];\n }\n}\n","import { AuthFeature, AuthFeatureKind, AuthService } 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 {\n BrowserCacheLocation,\n ILoggerCallback,\n IPublicClientApplication,\n InteractionType,\n LogLevel,\n PublicClientApplication\n} 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 MsalGuardConfigurationWithType\n} from './shared/auth-microsoft.interface';\nimport { AuthMsalService } from './shared/auth-msal.service';\n\nexport const AUTH_MICROSOFT_DIRECTIVES = [\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent\n] as const;\n\nexport function MSALConfigFactory(\n config: ConfigService\n): IPublicClientApplication {\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 msalInstance = new PublicClientApplication({\n auth: msConf,\n cache: {\n cacheLocation: BrowserCacheLocation.LocalStorage\n },\n system: {\n loggerOptions: {\n loggerCallback,\n piiLoggingEnabled: false,\n logLevel: LogLevel.Warning\n }\n }\n });\n\n return msalInstance;\n}\n\nconst loggerCallback: ILoggerCallback = (\n level: LogLevel,\n message: string,\n containsPii: boolean\n) => {\n if (containsPii) {\n return;\n }\n switch (level) {\n case LogLevel.Error:\n console.error(message);\n break;\n case LogLevel.Info:\n console.info(message);\n break;\n case LogLevel.Verbose:\n console.debug(message);\n break;\n case LogLevel.Warning:\n console.warn(message);\n break;\n }\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(\n config: ConfigService\n): MsalGuardConfigurationWithType {\n const msConf = config.getConfig('auth.microsoft') as AuthMicrosoftOptions;\n\n return {\n interactionType: InteractionType.Popup,\n authRequest: {\n scopes: ['user.read'],\n domainHint: msConf?.domainHint || ''\n },\n type: 'add'\n };\n}\n\nexport function MSALAngularConfigFactoryb2c(\n config: ConfigService\n): MsalGuardConfigurationWithType {\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 serviceFactory: IMsalServiceFactory = msalServiceFactory\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 provide: AuthService,\n useFactory: serviceFactory,\n deps: [ConfigService]\n }\n ]\n };\n }\n}\n\nexport type IMsalServiceFactory = (config: ConfigService) => AuthService;\n\nconst msalServiceFactory: IMsalServiceFactory = (config: ConfigService) => {\n const msConf = config.getConfig('auth.microsoft') as AuthMicrosoftOptions;\n\n if (!msConf) {\n return new AuthService();\n }\n\n return new AuthMsalService();\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAwBa,sBAAsB,CAAA;AACzB,IAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAoB;AAC7C,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;IAE9B,KAAK,GAAG,MAAM,EAAW;IAElC,KAAK,GAAG,EAAE;IAEV,QAAQ,GAAA;AACN,QAAA,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACvB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CAAC,gBAAgB,CAAyB;IAEzE,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,WAAW,EAAE;IAC1B;IAEA,OAAO,IAAI,eAAe,EAAE;AAC9B,CAAC;;ACrMD;;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/shared/auth-msal.service.ts","../../../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 OnInit,\n inject,\n output\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatError } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { AuthService } from '@igo2/auth';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { AuthMsalService } from '../shared/auth-msal.service';\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, MatError, MatIconModule, IgoLanguageModule]\n})\nexport class AuthMicrosoftComponent implements OnInit {\n private auth = inject(AuthService) as AuthMsalService;\n private appRef = inject(ApplicationRef);\n\n readonly login = output<boolean>();\n\n error = '';\n\n ngOnInit(): void {\n if (this.auth.autoLogin) {\n this.loginUser();\n }\n }\n\n public loginUser() {\n this.auth.login().subscribe({\n next: () => {\n this.appRef.tick();\n this.login.emit(true);\n },\n error: (err) => {\n this.auth\n .translateError('igo.auth.error.microsoft.', err)\n .subscribe((translatedErrorMsg) => {\n this.error = translatedErrorMsg;\n });\n }\n });\n }\n}\n","<button class=\"microsoft-login-button\" matButton=\"filled\" (click)=\"loginUser()\">\n <mat-icon\n ><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>Microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n@if (error) {\n <mat-error>{{ error }}</mat-error>\n}\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 HandleRedirectPromiseOptions,\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\n handleRedirectObservable(\n hashOrOptions?: string | HandleRedirectPromiseOptions\n ): Observable<AuthenticationResult | null> {\n let finalOptions: HandleRedirectPromiseOptions = {\n hash: this.redirectHash\n };\n\n if (typeof hashOrOptions === 'string') {\n finalOptions.hash = hashOrOptions;\n } else if (hashOrOptions) {\n finalOptions = { ...finalOptions, ...hashOrOptions };\n }\n\n return from(this.instance.handleRedirectPromise(finalOptions));\n }\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.logoutPopup(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 message.correlationId\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';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { AuthService } from '@igo2/auth';\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 MsalGuardConfigurationWithType\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, MatIconModule],\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<MsalGuardConfigurationWithType[]>(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 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(): MsalGuardConfigurationWithType {\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 <mat-icon>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n","import { Injectable, inject } from '@angular/core';\n\nimport { AuthOptions, AuthService, IUser } from '@igo2/auth';\n\nimport { MSAL_GUARD_CONFIG, MsalService } from '@azure/msal-angular';\nimport { PopupRequest } from '@azure/msal-browser';\nimport { Observable, finalize, switchMap, tap } from 'rxjs';\n\nimport {\n AuthMicrosoftOptions,\n MsalGuardConfigurationWithType\n} from './auth-microsoft.interface';\n\ninterface IAuthMsalOptions extends AuthOptions {\n microsoft: AuthMicrosoftOptions;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthMsalService extends AuthService<IAuthMsalOptions> {\n private msalService = inject(MsalService);\n private msalGuardConfig =\n inject<MsalGuardConfigurationWithType[]>(MSAL_GUARD_CONFIG);\n\n private _isInitialized$: Observable<void>;\n autoLogin = false;\n\n constructor() {\n super();\n\n this.autoLogin = this.authOptions.microsoft?.autoLogin === true;\n this._isInitialized$ = this.msalService.initialize();\n }\n\n login(): Observable<IUser | null> {\n this.isLogging.set(true);\n return this._isInitialized$.pipe(\n switchMap(() =>\n this.msalService.loginPopup(this.getConf().authRequest as PopupRequest)\n ),\n tap(({ account }) => this.msalService.instance.setActiveAccount(account)),\n switchMap(({ idToken, accessToken }) =>\n this.loginWithToken(\n accessToken,\n 'microsoft',\n { tokenId: idToken },\n this.authOptions.microsoft.applicationId\n )\n ),\n finalize(() => this.isLogging.set(false))\n );\n }\n\n logout(): void {\n if (this.msalService?.instance?.getActiveAccount()) {\n const logoutRequest = {\n account: this.msalService.instance.getActiveAccount()\n };\n this._isInitialized$\n .pipe(switchMap(() => this.msalService.logoutPopup(logoutRequest)))\n .subscribe(() => super.logout());\n } else {\n super.logout();\n }\n }\n\n private getConf(): MsalGuardConfigurationWithType {\n return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];\n }\n}\n","import { AuthFeature, AuthFeatureKind, AuthService } 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 {\n BrowserCacheLocation,\n ILoggerCallback,\n IPublicClientApplication,\n InteractionType,\n LogLevel,\n PublicClientApplication\n} 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 MsalGuardConfigurationWithType\n} from './shared/auth-microsoft.interface';\nimport { AuthMsalService } from './shared/auth-msal.service';\n\nexport const AUTH_MICROSOFT_DIRECTIVES = [\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent\n] as const;\n\nexport function MSALConfigFactory(\n config: ConfigService\n): IPublicClientApplication | undefined {\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 msalInstance = new PublicClientApplication({\n auth: msConf,\n cache: {\n cacheLocation: BrowserCacheLocation.LocalStorage\n },\n system: {\n loggerOptions: {\n loggerCallback,\n piiLoggingEnabled: false,\n logLevel: LogLevel.Warning\n }\n }\n });\n\n return msalInstance;\n}\n\nconst loggerCallback: ILoggerCallback = (\n level: LogLevel,\n message: string,\n containsPii: boolean\n) => {\n if (containsPii) {\n return;\n }\n switch (level) {\n case LogLevel.Error:\n console.error(message);\n break;\n case LogLevel.Info:\n console.info(message);\n break;\n case LogLevel.Verbose:\n console.debug(message);\n break;\n case LogLevel.Warning:\n console.warn(message);\n break;\n }\n};\n\nexport function MSALConfigFactoryb2c(\n config: ConfigService\n): PublicClientApplication | undefined {\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(\n config: ConfigService\n): MsalGuardConfigurationWithType {\n const msConf = config.getConfig('auth.microsoft') as AuthMicrosoftOptions;\n\n return {\n interactionType: InteractionType.Popup,\n authRequest: {\n scopes: ['user.read'],\n domainHint: msConf?.domainHint || ''\n },\n type: 'add'\n };\n}\n\nexport function MSALAngularConfigFactoryb2c(\n config: ConfigService\n): MsalGuardConfigurationWithType {\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 serviceFactory: IMsalServiceFactory = msalServiceFactory\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 provide: AuthService,\n useFactory: serviceFactory,\n deps: [ConfigService]\n }\n ]\n };\n }\n}\n\nexport type IMsalServiceFactory = (config: ConfigService) => AuthService;\n\nconst msalServiceFactory: IMsalServiceFactory = (config: ConfigService) => {\n const msConf = config.getConfig('auth.microsoft') as AuthMicrosoftOptions;\n\n if (!msConf) {\n return new AuthService();\n }\n\n return new AuthMsalService();\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAwBa,sBAAsB,CAAA;AACzB,IAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAoB;AAC7C,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;IAE9B,KAAK,GAAG,MAAM,EAAW;IAElC,KAAK,GAAG,EAAE;IAEV,QAAQ,GAAA;AACN,QAAA,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACvB,IAAI,CAAC,SAAS,EAAE;QAClB;IACF;IAEO,SAAS,GAAA;AACd,QAAA,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC;YAC1B,IAAI,EAAE,MAAK;AACT,gBAAA,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;AAClB,gBAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;YACvB,CAAC;AACD,YAAA,KAAK,EAAE,CAAC,GAAG,KAAI;AACb,gBAAA,IAAI,CAAC;AACF,qBAAA,cAAc,CAAC,2BAA2B,EAAE,GAAG;AAC/C,qBAAA,SAAS,CAAC,CAAC,kBAAkB,KAAI;A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,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,WAAW;AACX,gBAAA;AACE,oBAAA,OAAO,EAAE,WAAW;AACpB,oBAAA,UAAU,EAAE,cAAc;oBAC1B,IAAI,EAAE,CAAC,aAAa;AACrB;AACF;SACF;IACH;AACF;AAIA,MAAM,kBAAkB,GAAwB,CAAC,MAAqB,KAAI;IACxE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAyB;IAEzE,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,WAAW,EAAE;IAC1B;IAEA,OAAO,IAAI,eAAe,EAAE;AAC9B,CAAC;;ACrMD;;AAEG;;;;"}
@@ -26,7 +26,7 @@ class AuthMonitoringService {
26
26
  });
27
27
  }
28
28
  _identifyUser(user) {
29
- switch (this.monitoringOptions.provider) {
29
+ switch (this.monitoringOptions?.provider) {
30
30
  case 'sentry':
31
31
  identifySentryUser(user);
32
32
  break;
@@ -34,10 +34,10 @@ class AuthMonitoringService {
34
34
  break;
35
35
  }
36
36
  }
37
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthMonitoringService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
38
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
37
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthMonitoringService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
38
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
39
39
  }
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthMonitoringService, decorators: [{
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthMonitoringService, decorators: [{
41
41
  type: Injectable,
42
42
  args: [{
43
43
  providedIn: 'root'
@@ -1 +1 @@
1
- {"version":3,"file":"igo2-auth-monitoring.mjs","sources":["../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.service.ts","../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.provider.ts","../../../packages/auth/monitoring/src/igo2-auth-monitoring.ts"],"sourcesContent":["import { Injectable, Injector, inject } from '@angular/core';\n\nimport { AuthService, User } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\nimport {\n AnyMonitoringOptions,\n MONITORING_OPTIONS,\n identifySentryUser\n} from '@igo2/core/monitoring';\n\nimport { first, switchMap } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthMonitoringService {\n private configService = inject(ConfigService);\n private monitoringOptions = inject<AnyMonitoringOptions | null>(\n MONITORING_OPTIONS,\n { optional: true }\n );\n private injector = inject(Injector);\n\n // The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER\n authService?: AuthService;\n\n constructor() {\n if (!this.monitoringOptions?.identifyUser) {\n return;\n }\n\n this.configService.isLoaded$\n .pipe(\n first((isLoaded) => isLoaded),\n switchMap(() => {\n this.authService = this.injector.get(AuthService);\n return this.authService?.authenticate$;\n })\n )\n .subscribe((isAuthenticated) => {\n const user = isAuthenticated ? this.authService.user : null;\n this._identifyUser(user);\n });\n }\n\n private _identifyUser(user: User | null): void {\n switch (this.monitoringOptions.provider) {\n case 'sentry':\n identifySentryUser(user);\n break;\n\n default:\n break;\n }\n }\n}\n","import {\n EnvironmentProviders,\n Injector,\n Provider,\n inject,\n provideAppInitializer\n} from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\nimport {\n AnyMonitoringOptions,\n MONITORING_OPTIONS\n} from '@igo2/core/monitoring';\n\nimport { AuthMonitoringService } from './auth-monitoring.service';\n\nexport function provideAuthUserMonitoring(\n options: AnyMonitoringOptions | null\n): (Provider | EnvironmentProviders)[] {\n if (!options) {\n return [];\n }\n\n return [\n {\n provide: AuthMonitoringService,\n useClass: AuthMonitoringService,\n deps: [ConfigService, MONITORING_OPTIONS, Injector]\n },\n // Force instantiate Tracing service to avoid require it in any constructor.\n provideAppInitializer(() => {\n inject(AuthMonitoringService);\n return;\n })\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MAea,qBAAqB,CAAA;AACxB,IAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;IACrC,iBAAiB,GAAG,MAAM,CAChC,kBAAkB,EAClB,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB;AACO,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;;AAGnC,IAAA,WAAW;AAEX,IAAA,WAAA,GAAA;AACE,QAAA,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,EAAE;YACzC;QACF;QAEA,IAAI,CAAC,aAAa,CAAC;AAChB,aAAA,IAAI,CACH,KAAK,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,EAC7B,SAAS,CAAC,MAA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MAAK;YACzB,MAAM,CAAC,qBAAqB,CAAC;YAC7B;AACF,QAAA,CAAC;KACF;AACH;;ACnCA;;AAEG;;;;"}
1
+ {"version":3,"file":"igo2-auth-monitoring.mjs","sources":["../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.service.ts","../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.provider.ts","../../../packages/auth/monitoring/src/igo2-auth-monitoring.ts"],"sourcesContent":["import { Injectable, Injector, inject } from '@angular/core';\n\nimport { AuthService, User } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\nimport {\n AnyMonitoringOptions,\n MONITORING_OPTIONS,\n identifySentryUser\n} from '@igo2/core/monitoring';\n\nimport { first, switchMap } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthMonitoringService {\n private configService = inject(ConfigService);\n private monitoringOptions = inject<AnyMonitoringOptions | null>(\n MONITORING_OPTIONS,\n { optional: true }\n );\n private injector = inject(Injector);\n\n // The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER\n authService?: AuthService;\n\n constructor() {\n if (!this.monitoringOptions?.identifyUser) {\n return;\n }\n\n this.configService.isLoaded$\n .pipe(\n first((isLoaded) => isLoaded),\n switchMap(() => {\n this.authService = this.injector.get(AuthService);\n return this.authService?.authenticate$;\n })\n )\n .subscribe((isAuthenticated) => {\n const user = isAuthenticated ? this.authService!.user : null;\n this._identifyUser(user);\n });\n }\n\n private _identifyUser(user: User | null): void {\n switch (this.monitoringOptions?.provider) {\n case 'sentry':\n identifySentryUser(user);\n break;\n\n default:\n break;\n }\n }\n}\n","import {\n EnvironmentProviders,\n Injector,\n Provider,\n inject,\n provideAppInitializer\n} from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\nimport {\n AnyMonitoringOptions,\n MONITORING_OPTIONS\n} from '@igo2/core/monitoring';\n\nimport { AuthMonitoringService } from './auth-monitoring.service';\n\nexport function provideAuthUserMonitoring(\n options: AnyMonitoringOptions | null\n): (Provider | EnvironmentProviders)[] {\n if (!options) {\n return [];\n }\n\n return [\n {\n provide: AuthMonitoringService,\n useClass: AuthMonitoringService,\n deps: [ConfigService, MONITORING_OPTIONS, Injector]\n },\n // Force instantiate Tracing service to avoid require it in any constructor.\n provideAppInitializer(() => {\n inject(AuthMonitoringService);\n return;\n })\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MAea,qBAAqB,CAAA;AACxB,IAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;IACrC,iBAAiB,GAAG,MAAM,CAChC,kBAAkB,EAClB,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB;AACO,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;;AAGnC,IAAA,WAAW;AAEX,IAAA,WAAA,GAAA;AACE,QAAA,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,EAAE;YACzC;QACF;QAEA,IAAI,CAAC,aAAa,CAAC;AAChB,aAAA,IAAI,CACH,KAAK,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,EAC7B,SAAS,CAAC,MAAK;YACb,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC;AACjD,YAAA,OAAO,IAAI,CAAC,WAAW,EAAE,aAAa;AACxC,QAAA,CAAC,CAAC;AAEH,aAAA,SAAS,CAAC,CAAC,eAAe,KAAI;AAC7B,YAAA,MAAM,IAAI,GAAG,eAAe,GAAG,IAAI,CAAC,WAAY,CAAC,IAAI,GAAG,IAAI;AAC5D,YAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;AAC1B,QAAA,CAAC,CAAC;IACN;AAEQ,IAAA,aAAa,CAAC,IAAiB,EAAA;AACrC,QAAA,QAAQ,IAAI,CAAC,iBAAiB,EAAE,QAAQ;AACtC,YAAA,KAAK,QAAQ;gBACX,kBAAkB,CAAC,IAAI,CAAC;gBACxB;AAE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