@odx/auth 5.0.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +1 -0
- package/esm2020/index.mjs +1 -1
- package/esm2020/lib/auth.component.mjs +4 -4
- package/esm2020/lib/auth.config.mjs +2 -1
- package/esm2020/lib/auth.directive.mjs +4 -4
- package/esm2020/lib/auth.guard.mjs +1 -1
- package/esm2020/lib/auth.i18n.mjs +1 -1
- package/esm2020/lib/auth.module.mjs +5 -5
- package/esm2020/lib/auth.providers.mjs +9 -4
- package/esm2020/lib/auth.service.mjs +7 -4
- package/esm2020/lib/auth.typings.mjs +1 -1
- package/esm2020/lib/components/auth-actions/auth-actions.component.mjs +4 -4
- package/esm2020/lib/components/auth-loading-screen/auth-loading-screen.component.mjs +4 -4
- package/esm2020/lib/components/index.mjs +1 -1
- package/esm2020/lib/directives/auth-action.directive.mjs +4 -4
- package/esm2020/lib/directives/index.mjs +1 -1
- package/esm2020/lib/directives/sign-in.directive.mjs +4 -4
- package/esm2020/lib/directives/sign-out.directive.mjs +4 -4
- package/esm2020/lib/helpers/create-inititals.mjs +1 -1
- package/esm2020/lib/helpers/handle-auth-error.mjs +1 -1
- package/esm2020/lib/helpers/handle-oauth-event.mjs +1 -1
- package/esm2020/lib/helpers/index.mjs +1 -1
- package/esm2020/lib/helpers/resolve-email.mjs +1 -1
- package/esm2020/lib/helpers/resolve-username.mjs +1 -1
- package/esm2020/lib/models/auth-environment.mjs +1 -1
- package/esm2020/lib/models/auth-http-cache.mjs +4 -4
- package/esm2020/lib/models/auth-plugin-manager.mjs +10 -5
- package/esm2020/lib/models/authorized-handler.mjs +1 -1
- package/esm2020/lib/models/index.mjs +1 -1
- package/esm2020/lib/models/offline-auth-error-handler.mjs +1 -1
- package/esm2020/lib/plugins/core-identity.plugin.mjs +1 -1
- package/esm2020/lib/plugins/index.mjs +1 -2
- package/esm2020/lib/plugins/user-profile-link.plugin.mjs +1 -1
- package/esm2020/lib/unauth.guard.mjs +1 -1
- package/esm2020/odx-auth.mjs +1 -1
- package/esm2020/plugins/service-connect/index.mjs +1 -1
- package/esm2020/plugins/service-connect/lib/dtos/get-service-connect-rights-response.dto.mjs +1 -1
- package/esm2020/plugins/service-connect/lib/dtos/index.mjs +1 -1
- package/esm2020/plugins/service-connect/lib/helpers/build-service-connect-url.mjs +1 -1
- package/esm2020/plugins/service-connect/lib/helpers/has-roles-or-rights-handler.mjs +1 -1
- package/esm2020/plugins/service-connect/lib/helpers/has-roles-or-rights.mjs +1 -1
- package/esm2020/plugins/service-connect/lib/helpers/index.mjs +1 -1
- package/esm2020/plugins/service-connect/lib/helpers/service-connect-plugin-factory.mjs +1 -1
- package/esm2020/plugins/service-connect/lib/service-connect-rights.directive.mjs +4 -4
- package/esm2020/plugins/service-connect/lib/service-connect-rights.guard.mjs +1 -1
- package/esm2020/plugins/service-connect/lib/service-connect-rights.plugin.mjs +1 -1
- package/esm2020/plugins/service-connect/lib/service-connect.config.mjs +1 -1
- package/esm2020/plugins/service-connect/lib/service-connect.typings.mjs +1 -1
- package/esm2020/plugins/service-connect/odx-auth-plugins-service-connect.mjs +1 -1
- package/fesm2015/odx-auth-plugins-service-connect.mjs +3 -3
- package/fesm2015/odx-auth-plugins-service-connect.mjs.map +1 -1
- package/fesm2015/odx-auth.mjs +50 -49
- package/fesm2015/odx-auth.mjs.map +1 -1
- package/fesm2020/odx-auth-plugins-service-connect.mjs +3 -3
- package/fesm2020/odx-auth-plugins-service-connect.mjs.map +1 -1
- package/fesm2020/odx-auth.mjs +50 -49
- package/fesm2020/odx-auth.mjs.map +1 -1
- package/lib/auth.config.d.ts +1 -0
- package/lib/plugins/index.d.ts +0 -1
- package/package.json +5 -5
- package/esm2020/lib/plugins/loading-screen-plugin.mjs +0 -16
- package/lib/plugins/loading-screen-plugin.d.ts +0 -2
package/fesm2020/odx-auth.mjs
CHANGED
|
@@ -146,6 +146,7 @@ const { AuthDefaultConfig, AuthConfig, injectAuthConfig, provideAuthConfig } = c
|
|
|
146
146
|
enableLoadingScreen: true,
|
|
147
147
|
loadingScreenMessage: null,
|
|
148
148
|
refreshTokenOnInit: true,
|
|
149
|
+
requireSignIn: false,
|
|
149
150
|
});
|
|
150
151
|
|
|
151
152
|
var translations = {
|
|
@@ -199,9 +200,9 @@ class AuthHttpCache {
|
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
202
|
AuthHttpCache.CACHE_KEY = '@odx/auth/http-cache';
|
|
202
|
-
AuthHttpCache.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
203
|
-
AuthHttpCache.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
203
|
+
AuthHttpCache.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthHttpCache, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
204
|
+
AuthHttpCache.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthHttpCache, providedIn: 'root' });
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthHttpCache, decorators: [{
|
|
205
206
|
type: Injectable,
|
|
206
207
|
args: [{ providedIn: 'root' }]
|
|
207
208
|
}], ctorParameters: function () { return []; } });
|
|
@@ -218,7 +219,12 @@ class AuthPluginManager {
|
|
|
218
219
|
if (this.plugins.length < 1) {
|
|
219
220
|
return of({});
|
|
220
221
|
}
|
|
221
|
-
return authService.isInitialized$.pipe(switchMap(() =>
|
|
222
|
+
return authService.isInitialized$.pipe(switchMap(() => {
|
|
223
|
+
if (!authService.getAccessToken()) {
|
|
224
|
+
return of({});
|
|
225
|
+
}
|
|
226
|
+
return combineLatest(this.plugins.map((plugin) => plugin(authService).pipe(catchError(this.handlePluginError.bind(this))))).pipe(map((results) => deepmerge(...results)));
|
|
227
|
+
}), tap((result) => this.result$$.next(result)), take(1));
|
|
222
228
|
}
|
|
223
229
|
getResult() {
|
|
224
230
|
return this.result$$.getValue() ?? {};
|
|
@@ -228,9 +234,9 @@ class AuthPluginManager {
|
|
|
228
234
|
return of({});
|
|
229
235
|
}
|
|
230
236
|
}
|
|
231
|
-
AuthPluginManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
232
|
-
AuthPluginManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
233
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
237
|
+
AuthPluginManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthPluginManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
238
|
+
AuthPluginManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthPluginManager, providedIn: 'root' });
|
|
239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthPluginManager, decorators: [{
|
|
234
240
|
type: Injectable,
|
|
235
241
|
args: [{ providedIn: 'root' }]
|
|
236
242
|
}] });
|
|
@@ -281,6 +287,9 @@ class AuthService {
|
|
|
281
287
|
}
|
|
282
288
|
}
|
|
283
289
|
this.isInitialized$$.next(true);
|
|
290
|
+
if (this.authConfig.requireSignIn && !this.isAuthenticated()) {
|
|
291
|
+
this.signIn(this.windowRef.location.pathname);
|
|
292
|
+
}
|
|
284
293
|
await this.tryLoadUserProfile();
|
|
285
294
|
await this.routeToRequestedUrl();
|
|
286
295
|
}
|
|
@@ -370,9 +379,9 @@ class AuthService {
|
|
|
370
379
|
}
|
|
371
380
|
}
|
|
372
381
|
}
|
|
373
|
-
AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
374
|
-
AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
375
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
382
|
+
AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
383
|
+
AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthService, providedIn: 'root' });
|
|
384
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthService, decorators: [{
|
|
376
385
|
type: Injectable,
|
|
377
386
|
args: [{ providedIn: 'root' }]
|
|
378
387
|
}], ctorParameters: function () { return []; } });
|
|
@@ -383,12 +392,12 @@ let AuthActionsComponent = class AuthActionsComponent {
|
|
|
383
392
|
this.claims = null;
|
|
384
393
|
}
|
|
385
394
|
};
|
|
386
|
-
AuthActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
387
|
-
AuthActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.
|
|
395
|
+
AuthActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
396
|
+
AuthActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AuthActionsComponent, isStandalone: true, selector: "odx-auth-actions", inputs: { claims: "claims" }, ngImport: i0, template: "<odx-list>\n <a data-testid=\"odx-auth-user-profile-link\" odxListItem [href]=\"url\" rel=\"noopener\" target=\"_blank\" *ngIf=\"claims?.userProfileUrl as url\">\n <odx-icon name=\"user-administration\" iconSet=\"core\" odxListPrefix></odx-icon>\n {{ 'userProfileLink' | odxTranslate | async }}\n </a>\n</odx-list>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ListModule }, { kind: "component", type: i2.ListComponent, selector: "odx-list", inputs: ["multiple"] }, { kind: "component", type: i2.ListItemComponent, selector: "[odxListItem]", inputs: ["danger", "selected"] }, { kind: "component", type: i3.IconComponent, selector: "odx-icon", inputs: ["inline", "size", "name", "iconSet"] }, { kind: "pipe", type: TranslatePipe, name: "odxTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
388
397
|
AuthActionsComponent = __decorate([
|
|
389
398
|
CSSComponent('auth-actions')
|
|
390
399
|
], AuthActionsComponent);
|
|
391
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
400
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthActionsComponent, decorators: [{
|
|
392
401
|
type: Component,
|
|
393
402
|
args: [{ standalone: true, selector: 'odx-auth-actions', imports: [CoreModule, ListModule, TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<odx-list>\n <a data-testid=\"odx-auth-user-profile-link\" odxListItem [href]=\"url\" rel=\"noopener\" target=\"_blank\" *ngIf=\"claims?.userProfileUrl as url\">\n <odx-icon name=\"user-administration\" iconSet=\"core\" odxListPrefix></odx-icon>\n {{ 'userProfileLink' | odxTranslate | async }}\n </a>\n</odx-list>\n" }]
|
|
394
403
|
}], propDecorators: { claims: [{
|
|
@@ -413,9 +422,9 @@ class AuthLoadingScreenComponent {
|
|
|
413
422
|
}
|
|
414
423
|
}
|
|
415
424
|
AuthLoadingScreenComponent.instance = null;
|
|
416
|
-
AuthLoadingScreenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
417
|
-
AuthLoadingScreenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.
|
|
418
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
425
|
+
AuthLoadingScreenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthLoadingScreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
426
|
+
AuthLoadingScreenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AuthLoadingScreenComponent, isStandalone: true, selector: "div.odx-auth-loading-screen", host: { properties: { "@hostAnimation": "true" } }, ngImport: i0, template: "<div class=\"odx-auth-loading-screen__content\" odxLayout=\"grid 12 horizontal-center vertical-center gap-small\">\n <odx-logo size=\"large\"></odx-logo>\n <odx-circular-progress class=\"odx-auth-loading-screen__spinner\" value=\"-1\" size=\"medium\" stroke=\"3\">\n <odx-icon [name]=\"icon$ | async\" iconSet=\"core\"></odx-icon>\n </odx-circular-progress>\n <p class=\"odx-auth-loading-screen__message\" *ngIf=\"authConfig.loadingScreenMessage as content\">\n <ng-template [odxDynamicView]=\"content\"></ng-template>\n </p>\n</div>\n", styles: ["@keyframes odx-auth-loading-screen-animation{0%{opacity:0;transform:translate(-50%,-50%) scale(.9)}to{opacity:1;transform:translate(-50%,-50%)}}.odx-auth-loading-screen{--odx-c-highlight: var(--odx-c-primary);background-color:var(--odx-c-background-content);position:fixed;z-index:var(--odx-v-layer-5);inset:0}.odx-auth-loading-screen__content{top:50%;left:50%;transform:translate(-50%,-50%);position:absolute;animation:odx-auth-loading-screen-animation .75s ease}.odx-auth-loading-screen__message{text-align:center}.odx-auth-loading-screen__spinner{position:relative}.odx-auth-loading-screen__spinner .odx-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: IconComponent, selector: "odx-icon", inputs: ["inline", "size", "name", "iconSet"] }, { kind: "directive", type: LogoDirective, selector: "odx-logo", inputs: ["size", "variant"] }, { kind: "component", type: CircularProgressComponent, selector: "odx-circular-progress", inputs: ["stroke", "size", "value"] }, { kind: "directive", type: DynamicViewDirective, selector: "ng-template[odxDynamicView]", inputs: ["odxDynamicView", "odxDynamicViewInjector", "odxDynamicViewContext"] }], animations: [trigger('hostAnimation', [transition(':leave', useAnimation(fadeOut()))])], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
427
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthLoadingScreenComponent, decorators: [{
|
|
419
428
|
type: Component,
|
|
420
429
|
args: [{ standalone: true, selector: 'div.odx-auth-loading-screen', imports: [CommonModule, ButtonComponent, IconComponent, LogoDirective, CircularProgressComponent, DynamicViewDirective], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
421
430
|
'[@hostAnimation]': 'true',
|
|
@@ -435,9 +444,9 @@ class AuthActionDirective {
|
|
|
435
444
|
});
|
|
436
445
|
}
|
|
437
446
|
}
|
|
438
|
-
AuthActionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
439
|
-
AuthActionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
440
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
447
|
+
AuthActionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthActionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
448
|
+
AuthActionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: AuthActionDirective, ngImport: i0 });
|
|
449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthActionDirective, decorators: [{
|
|
441
450
|
type: Directive
|
|
442
451
|
}] });
|
|
443
452
|
|
|
@@ -452,9 +461,9 @@ class SignInDirective extends AuthActionDirective {
|
|
|
452
461
|
this.afterSignIn.next();
|
|
453
462
|
}
|
|
454
463
|
}
|
|
455
|
-
SignInDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
456
|
-
SignInDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
457
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
464
|
+
SignInDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SignInDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
465
|
+
SignInDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: SignInDirective, isStandalone: true, selector: "[odxButton][odxAuthSignIn]", outputs: { afterSignIn: "odxAuthSignIn" }, host: { listeners: { "click": "handleClick()" } }, usesInheritance: true, hostDirectives: [{ directive: i1$1.LoadingSpinnerDirective }], ngImport: i0 });
|
|
466
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SignInDirective, decorators: [{
|
|
458
467
|
type: Directive,
|
|
459
468
|
args: [{
|
|
460
469
|
standalone: true,
|
|
@@ -480,9 +489,9 @@ class SignOutDirective extends AuthActionDirective {
|
|
|
480
489
|
this.afterSignOut.next();
|
|
481
490
|
}
|
|
482
491
|
}
|
|
483
|
-
SignOutDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
484
|
-
SignOutDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
485
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
492
|
+
SignOutDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SignOutDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
493
|
+
SignOutDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: SignOutDirective, isStandalone: true, selector: "[odxButton][odxAuthSignOut]", outputs: { afterSignOut: "odxAuthSignOut" }, host: { listeners: { "click": "handleClick()" } }, usesInheritance: true, hostDirectives: [{ directive: i1$1.LoadingSpinnerDirective }], ngImport: i0 });
|
|
494
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SignOutDirective, decorators: [{
|
|
486
495
|
type: Directive,
|
|
487
496
|
args: [{
|
|
488
497
|
standalone: true,
|
|
@@ -508,9 +517,9 @@ class AuthComponent {
|
|
|
508
517
|
};
|
|
509
518
|
}
|
|
510
519
|
}
|
|
511
|
-
AuthComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
512
|
-
AuthComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.
|
|
513
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
520
|
+
AuthComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
521
|
+
AuthComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AuthComponent, isStandalone: true, selector: "odx-auth", providers: [provideTranslations(translations)], ngImport: i0, template: "<odx-action-group>\n <ng-template [ngrxLet]=\"{ idClaims: authService.identityClaims$, isAuthenticated: authService.isAuthenticated$ }\" let-vm>\n <ng-template [ngIf]=\"vm.isAuthenticated\" [ngIfElse]=\"notAuthenticated\">\n <button odxButton [odxDropdown]=\"userProfileMenu\" [odxDropdownOptions]=\"dropdownOptions\" data-testid=\"odx-auth-user-profile-button\">\n <ng-template [ngTemplateOutlet]=\"userAvatar\"></ng-template>\n </button>\n <ng-template #userProfileMenu>\n <odx-area-header class=\"odx-padding-x-12\" size=\"small\">\n <ng-template [ngTemplateOutlet]=\"userAvatar\" ngProjectAs=\"odx-avatar\"></ng-template>\n {{ vm.idClaims?.username }}\n <odx-area-header-subtitle>\n {{ vm.idClaims?.email }}\n </odx-area-header-subtitle>\n </odx-area-header>\n <ng-content></ng-content>\n <odx-auth-actions [claims]=\"vm.idClaims\"></odx-auth-actions>\n <div class=\"odx-margin-top-12\" odxLayout=\"flex vertical-center\">\n <odx-logo odxLayout=\"auto\" class=\"odx-margin-left-12 odx-margin-right-auto\"></odx-logo>\n <button odxButton odxAuthSignOut variant=\"ghost\" data-testid=\"odx-auth-sign-out-button\">\n {{ 'signOutButtonText' | odxTranslate | async }}\n <odx-icon name=\"logout\" alignRight></odx-icon>\n </button>\n </div>\n </ng-template>\n </ng-template>\n <ng-template #notAuthenticated>\n <button class=\"odx-auth-sign-in\" odxButton odxAuthSignIn variant=\"secondary\" data-testid=\"odx-auth-sign-in-button\">\n <odx-icon name=\"user\" alignLeft></odx-icon>\n {{ 'signInButtonText' | odxTranslate | async }}\n </button>\n </ng-template>\n <ng-template #userAvatar>\n <odx-avatar class=\"odx-auth-user-avatar\">\n {{ vm.idClaims?.initials ?? '' }}\n </odx-avatar>\n </ng-template>\n </ng-template>\n</odx-action-group>\n", styles: [".odx-auth-user-profile .odx-dropdown__inner>.odx-area-header{max-width:max(360px,25vw);min-width:296px}.odx-auth-actions{display:block;margin-top:calc(var(--odx-vertical-rythm-base-size) * .5);margin-bottom:calc(var(--odx-vertical-rythm-base-size) * .5);margin-right:calc(var(--odx-vertical-rythm-base-size) * .25);margin-left:calc(var(--odx-vertical-rythm-base-size) * .25)}\n"], dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "directive", type: i2$1.LetDirective, selector: "[ngrxLet]", inputs: ["ngrxLet", "ngrxLetSuspenseTpl"] }, { kind: "ngmodule", type: AreaHeaderModule }, { kind: "component", type: i3$1.AreaHeaderComponent, selector: "odx-area-header", inputs: ["size"] }, { kind: "directive", type: i3$1.AreaHeaderSubtitleDirective, selector: "odx-area-header-subtitle" }, { kind: "component", type: i4.AvatarComponent, selector: "odx-avatar", inputs: ["size", "variant"] }, { kind: "component", type: i5.ActionGroupComponent, selector: "odx-action-group", inputs: ["reverse"] }, { kind: "component", type: i6.ButtonComponent, selector: "button[odxButton], a[odxButton]", inputs: ["variant", "size"] }, { kind: "component", type: i3.IconComponent, selector: "odx-icon", inputs: ["inline", "size", "name", "iconSet"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "directive", type: i8.DropdownDirective, selector: "[odxDropdown]", inputs: ["odxDropdown", "odxDropdownDisabled", "odxDropdownShowLoader", "odxDropdownClickOutsideActive", "odxDropdownOptions", "odxDropdownReferenceElement", "odxDropdownTriggerElement", "odxDropdownHost", "odxDropdownOpenTrigger", "odxDropdownCloseTrigger"], outputs: ["odxDropdownBeforeOpen", "odxDropdownAfterOpen", "odxDropdownBeforeClose", "odxDropdownAfterClose"], exportAs: ["odxDropdown"] }, { kind: "ngmodule", type: HeaderModule }, { kind: "directive", type: LogoDirective, selector: "odx-logo", inputs: ["size", "variant"] }, { kind: "directive", type: SignInDirective, selector: "[odxButton][odxAuthSignIn]", outputs: ["odxAuthSignIn"] }, { kind: "directive", type: SignOutDirective, selector: "[odxButton][odxAuthSignOut]", outputs: ["odxAuthSignOut"] }, { kind: "ngmodule", type: LoadingSpinnerModule }, { kind: "component", type: AuthActionsComponent, selector: "odx-auth-actions", inputs: ["claims"] }, { kind: "pipe", type: TranslatePipe, name: "odxTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
522
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthComponent, decorators: [{
|
|
514
523
|
type: Component,
|
|
515
524
|
args: [{ standalone: true, selector: 'odx-auth', imports: [
|
|
516
525
|
CoreModule,
|
|
@@ -544,9 +553,9 @@ class AuthDirective {
|
|
|
544
553
|
});
|
|
545
554
|
}
|
|
546
555
|
}
|
|
547
|
-
AuthDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
548
|
-
AuthDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
549
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
556
|
+
AuthDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
557
|
+
AuthDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: AuthDirective, isStandalone: true, selector: "ng-template[odxAuth]", inputs: { authorizationHandler: ["odxAuth", "authorizationHandler"], elseTemplate: ["odxAuthElse", "elseTemplate"] }, hostDirectives: [{ directive: i1.NgIf }], ngImport: i0 });
|
|
558
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthDirective, decorators: [{
|
|
550
559
|
type: Directive,
|
|
551
560
|
args: [{
|
|
552
561
|
standalone: true,
|
|
@@ -588,10 +597,10 @@ function authGuard(authorizedHandler, redirectTo) {
|
|
|
588
597
|
const modules = [AuthComponent, AuthDirective, SignInDirective, SignOutDirective];
|
|
589
598
|
class AuthModule {
|
|
590
599
|
}
|
|
591
|
-
AuthModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
592
|
-
AuthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.
|
|
593
|
-
AuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.
|
|
594
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
600
|
+
AuthModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
601
|
+
AuthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: AuthModule, imports: [AuthComponent, AuthDirective, SignInDirective, SignOutDirective], exports: [AuthComponent, AuthDirective, SignInDirective, SignOutDirective] });
|
|
602
|
+
AuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthModule, imports: [AuthComponent] });
|
|
603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AuthModule, decorators: [{
|
|
595
604
|
type: NgModule,
|
|
596
605
|
args: [{
|
|
597
606
|
imports: [...modules],
|
|
@@ -610,17 +619,6 @@ const coreIdentityPlugin = () => {
|
|
|
610
619
|
};
|
|
611
620
|
};
|
|
612
621
|
|
|
613
|
-
const loadingScreenPlugin = () => {
|
|
614
|
-
const { enableLoadingScreen } = injectAuthConfig();
|
|
615
|
-
const dynamicViewService = inject(DynamicViewService);
|
|
616
|
-
return (authService) => {
|
|
617
|
-
if (enableLoadingScreen) {
|
|
618
|
-
AuthLoadingScreenComponent.initialize(authService, dynamicViewService);
|
|
619
|
-
}
|
|
620
|
-
return of({});
|
|
621
|
-
};
|
|
622
|
-
};
|
|
623
|
-
|
|
624
622
|
const userProfileUrlPlugin = () => {
|
|
625
623
|
const { environment, userProfileUrl } = injectAuthConfig();
|
|
626
624
|
return () => {
|
|
@@ -644,10 +642,13 @@ function initializeAuthErrorHandlers() {
|
|
|
644
642
|
authService.errors$.pipe(tap((error) => handler(error))).subscribe();
|
|
645
643
|
}
|
|
646
644
|
function initalizeAuthConfig() {
|
|
647
|
-
const { clientId, scopes, redirectPath, environment, postLogoutRedirectUrl, issuer, timeoutFactor, discoveryUrl } = injectAuthConfig();
|
|
645
|
+
const { clientId, scopes, redirectPath, environment, postLogoutRedirectUrl, issuer, timeoutFactor, discoveryUrl, enableLoadingScreen } = injectAuthConfig();
|
|
648
646
|
const authService = inject(AuthService);
|
|
649
647
|
const origin = inject(WindowRef).getOrigin();
|
|
650
648
|
const scope = Array.from(new Set(DEFAULT_AUTH_SCOPES.concat(scopes ?? []))).join(' ');
|
|
649
|
+
if (enableLoadingScreen) {
|
|
650
|
+
AuthLoadingScreenComponent.initialize(authService, inject(DynamicViewService));
|
|
651
|
+
}
|
|
651
652
|
return () => authService.initialize({
|
|
652
653
|
clientId,
|
|
653
654
|
issuer: issuer ?? DEFAULT_ISSUERS[environment],
|
|
@@ -689,7 +690,7 @@ function provideAuth(config) {
|
|
|
689
690
|
},
|
|
690
691
|
{
|
|
691
692
|
provide: ODX_AUTH_CORE_PLUGINS,
|
|
692
|
-
useValue: [coreIdentityPlugin,
|
|
693
|
+
useValue: [coreIdentityPlugin, userProfileUrlPlugin],
|
|
693
694
|
},
|
|
694
695
|
]);
|
|
695
696
|
}
|
|
@@ -716,5 +717,5 @@ function unauthGuard(authorizedHandler, redirectTo) {
|
|
|
716
717
|
* Generated bundle index. Do not edit.
|
|
717
718
|
*/
|
|
718
719
|
|
|
719
|
-
export { AuthActionDirective, AuthActionsComponent, AuthComponent, AuthConfig, AuthDefaultConfig, AuthDirective, AuthHttpCache, AuthLoadingScreenComponent, AuthModule, AuthPluginManager, AuthService, DEFAULT_AUTH_SCOPES, DEFAULT_ISSUERS, DEFAULT_USER_PROFILE_URLS, ODX_AUTH_CORE_PLUGINS, ODX_AUTH_ERROR_HANDLERS, ODX_AUTH_HTTP_CACHE_STORAGE, ODX_AUTH_PLUGINS, SignInDirective, SignOutDirective, authGuard, configureInterceptor, coreIdentityPlugin, createInitials, handleAuthError, handleOAuthEvent, initalizeAuthConfig, initializeAuthErrorHandlers, injectAuthConfig,
|
|
720
|
+
export { AuthActionDirective, AuthActionsComponent, AuthComponent, AuthConfig, AuthDefaultConfig, AuthDirective, AuthHttpCache, AuthLoadingScreenComponent, AuthModule, AuthPluginManager, AuthService, DEFAULT_AUTH_SCOPES, DEFAULT_ISSUERS, DEFAULT_USER_PROFILE_URLS, ODX_AUTH_CORE_PLUGINS, ODX_AUTH_ERROR_HANDLERS, ODX_AUTH_HTTP_CACHE_STORAGE, ODX_AUTH_PLUGINS, SignInDirective, SignOutDirective, authGuard, configureInterceptor, coreIdentityPlugin, createInitials, handleAuthError, handleOAuthEvent, initalizeAuthConfig, initializeAuthErrorHandlers, injectAuthConfig, offlineAuthErrorHandler, provideAuth, provideAuthConfig, resolveEmail, resolveUsername, unauthGuard, userProfileUrlPlugin };
|
|
720
721
|
//# sourceMappingURL=odx-auth.mjs.map
|