@acorex/modules 20.1.0 → 20.2.0-next.0
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/auth/index.d.ts +4 -57
- package/conversation/index.d.ts +69 -9
- package/dashboard-management/index.d.ts +2 -0
- package/fesm2022/{acorex-modules-auth-acorex-modules-auth-5TIjp5UG.mjs → acorex-modules-auth-acorex-modules-auth-y6rICHrT.mjs} +84 -201
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-y6rICHrT.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-app-chooser.component-B0w1Xzx7.mjs → acorex-modules-auth-app-chooser.component-Cpy0VN6n.mjs} +4 -4
- package/fesm2022/{acorex-modules-auth-app-chooser.component-B0w1Xzx7.mjs.map → acorex-modules-auth-app-chooser.component-Cpy0VN6n.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-login.module-B8sVVZHV.mjs → acorex-modules-auth-login.module-ZEX4NMuJ.mjs} +4 -4
- package/fesm2022/{acorex-modules-auth-login.module-B8sVVZHV.mjs.map → acorex-modules-auth-login.module-ZEX4NMuJ.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-master.layout-CMKxj1Qo.mjs → acorex-modules-auth-master.layout-D-lIn4Pl.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-master.layout-CMKxj1Qo.mjs.map → acorex-modules-auth-master.layout-D-lIn4Pl.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-password.component-DH0qKunk.mjs → acorex-modules-auth-password.component-CafZfqKe.mjs} +7 -7
- package/fesm2022/{acorex-modules-auth-password.component-DH0qKunk.mjs.map → acorex-modules-auth-password.component-CafZfqKe.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth-password.component-DLCb0_6e.mjs +134 -0
- package/fesm2022/acorex-modules-auth-password.component-DLCb0_6e.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-routes-Q9zaIiBS.mjs → acorex-modules-auth-routes-D9-qfC3V.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-routes-Q9zaIiBS.mjs.map → acorex-modules-auth-routes-D9-qfC3V.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-tenant-chooser.component-wp7OOLsH.mjs → acorex-modules-auth-tenant-chooser.component-B1aE-TOD.mjs} +10 -13
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-B1aE-TOD.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-two-factor-code.component-DSWd06bn.mjs → acorex-modules-auth-two-factor-code.component-BglerlU-.mjs} +6 -6
- package/fesm2022/{acorex-modules-auth-two-factor-code.component-DSWd06bn.mjs.map → acorex-modules-auth-two-factor-code.component-BglerlU-.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-two-factor.module-oRixkeAn.mjs → acorex-modules-auth-two-factor.module-D3N2XyOH.mjs} +3 -3
- package/fesm2022/{acorex-modules-auth-two-factor.module-oRixkeAn.mjs.map → acorex-modules-auth-two-factor.module-D3N2XyOH.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth.mjs +1 -1
- package/fesm2022/acorex-modules-conversation.mjs +487 -57
- package/fesm2022/acorex-modules-conversation.mjs.map +1 -1
- package/fesm2022/acorex-modules-notification-management.mjs +109 -3
- package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-security-management.mjs +301 -837
- package/fesm2022/acorex-modules-security-management.mjs.map +1 -1
- package/notification-management/index.d.ts +125 -29
- package/package.json +5 -5
- package/report-management/index.d.ts +2 -0
- package/security-management/index.d.ts +4 -13
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-5TIjp5UG.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-oauth-callback.component-C95YLpI_.mjs +0 -101
- package/fesm2022/acorex-modules-auth-oauth-callback.component-C95YLpI_.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-password.component-Du0EBIiw.mjs +0 -239
- package/fesm2022/acorex-modules-auth-password.component-Du0EBIiw.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-wp7OOLsH.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-user-sessions.component-8wwWI0cQ.mjs +0 -135
- package/fesm2022/acorex-modules-auth-user-sessions.component-8wwWI0cQ.mjs.map +0 -1
@@ -1,18 +1,15 @@
|
|
1
|
-
import { AXPUnauthorizedError, AXPUnauthenticatedError, AXPSessionService,
|
1
|
+
import { AXPUnauthorizedError, AXPUnauthenticatedError, AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
|
2
2
|
import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
|
3
|
-
import * as i1$3 from '@angular/common/http';
|
4
3
|
import { HttpErrorResponse } from '@angular/common/http';
|
5
4
|
import * as i0 from '@angular/core';
|
6
5
|
import { inject, isDevMode, Injectable, InjectionToken, Component, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, signal, NgModule, Injector } from '@angular/core';
|
7
|
-
import * as i1$
|
6
|
+
import * as i1$1 from '@angular/router';
|
8
7
|
import { Router, RouterModule, ROUTES } from '@angular/router';
|
9
|
-
import * as i1$
|
10
|
-
import { AXPHomePageService, AXPDataProvider,
|
11
|
-
import * as
|
8
|
+
import * as i1$3 from '@acorex/platform/common';
|
9
|
+
import { AXPHomePageService, AXPDataProvider, AXPCommonModule, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER } from '@acorex/platform/common';
|
10
|
+
import * as i3 from '@angular/common';
|
12
11
|
import { CommonModule, AsyncPipe } from '@angular/common';
|
13
|
-
import { firstValueFrom, of, first, Subject, timer
|
14
|
-
import * as i1$4 from '@acorex/platform/layout/components';
|
15
|
-
import { AXPUserAvatarComponent, AXPComponentSlotModule } from '@acorex/platform/layout/components';
|
12
|
+
import { firstValueFrom, of, first, Subject, timer } from 'rxjs';
|
16
13
|
import * as i2$1 from '@acorex/components/button';
|
17
14
|
import { AXButtonModule } from '@acorex/components/button';
|
18
15
|
import * as i1 from '@acorex/components/decorators';
|
@@ -27,11 +24,11 @@ import { AXPopupService } from '@acorex/components/popup';
|
|
27
24
|
import { AXPlatform } from '@acorex/core/platform';
|
28
25
|
import * as i6 from '@acorex/core/translation';
|
29
26
|
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
27
|
+
import * as i1$2 from '@acorex/platform/layout/components';
|
28
|
+
import { AXPUserAvatarComponent, AXPComponentSlotModule } from '@acorex/platform/layout/components';
|
30
29
|
import { AXChipsModule } from '@acorex/components/chips';
|
31
30
|
import { AXTagModule } from '@acorex/components/tag';
|
32
|
-
import { AXPPlatformScope } from '@acorex/platform/core';
|
33
31
|
import { startWith, switchMap, tap } from 'rxjs/operators';
|
34
|
-
import { AXMEntityCrudServiceImpl } from '@acorex/platform/layout/entity';
|
35
32
|
|
36
33
|
class AXMAuthErrorHandler {
|
37
34
|
constructor() {
|
@@ -107,22 +104,18 @@ const routes = [
|
|
107
104
|
},
|
108
105
|
{
|
109
106
|
path: '',
|
110
|
-
loadComponent: () => import('./acorex-modules-auth-master.layout-
|
111
|
-
loadChildren: () => import('./acorex-modules-auth-login.module-
|
107
|
+
loadComponent: () => import('./acorex-modules-auth-master.layout-D-lIn4Pl.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
|
108
|
+
loadChildren: () => import('./acorex-modules-auth-login.module-ZEX4NMuJ.mjs').then((c) => c.AXPSignInModule),
|
112
109
|
},
|
113
110
|
{
|
114
111
|
path: '',
|
115
|
-
loadComponent: () => import('./acorex-modules-auth-master.layout-
|
116
|
-
loadChildren: () => import('./acorex-modules-auth-two-factor.module-
|
112
|
+
loadComponent: () => import('./acorex-modules-auth-master.layout-D-lIn4Pl.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
|
113
|
+
loadChildren: () => import('./acorex-modules-auth-two-factor.module-D3N2XyOH.mjs').then((c) => c.AXPTwoFactorModule),
|
117
114
|
},
|
118
115
|
{
|
119
116
|
path: '',
|
120
|
-
loadComponent: () => import('./acorex-modules-auth-master.layout-
|
121
|
-
loadChildren: () => import('./acorex-modules-auth-routes-
|
122
|
-
},
|
123
|
-
{
|
124
|
-
path: 'axp-oauth-callback',
|
125
|
-
loadComponent: () => import('./acorex-modules-auth-oauth-callback.component-C95YLpI_.mjs').then((c) => c.AXPOAuthCallbackComponent),
|
117
|
+
loadComponent: () => import('./acorex-modules-auth-master.layout-D-lIn4Pl.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
|
118
|
+
loadChildren: () => import('./acorex-modules-auth-routes-D9-qfC3V.mjs').then((c) => c),
|
126
119
|
},
|
127
120
|
{
|
128
121
|
path: 'account',
|
@@ -130,11 +123,6 @@ const routes = [
|
|
130
123
|
loadChildren: () => Promise.resolve().then(function () { return account_module; }).then((c) => c.AXPAccountModule),
|
131
124
|
},
|
132
125
|
// {
|
133
|
-
// path: 'signincallback',
|
134
|
-
// loadComponent: () =>
|
135
|
-
// import('./pages/callback/oauth-callback.component').then((c) => c.AXPOAuthCallbackComponent),
|
136
|
-
// },
|
137
|
-
// {
|
138
126
|
// path: '',
|
139
127
|
// loadComponent: () =>
|
140
128
|
// import('./shared/layouts/master/master.layout').then((c) => c.AXPAuthMasterLayoutComponent),
|
@@ -171,20 +159,16 @@ class AXPAppChooserListComponent {
|
|
171
159
|
this.router = inject(Router);
|
172
160
|
this.sessionService = inject(AXPSessionService);
|
173
161
|
this.homePageService = inject(AXPHomePageService);
|
174
|
-
this.authStrategyRegistry = inject(AXPAuthStrategyRegistryService);
|
175
|
-
this.oidcStrategy = this.authStrategyRegistry.get('oidc');
|
176
162
|
this.selectedApplication = null;
|
177
163
|
this.applications$ = this.sessionService.applications$;
|
178
164
|
}
|
179
165
|
async chooseApplication(item) {
|
180
166
|
this.selectedApplication = item;
|
181
|
-
|
182
|
-
|
183
|
-
this.oidcStrategy.startAuthorizationFlow(tenantId, item.id);
|
184
|
-
}
|
167
|
+
await this.sessionService.setApplication(item);
|
168
|
+
await this.homePageService.navigateTo();
|
185
169
|
}
|
186
170
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPAppChooserListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
187
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: AXPAppChooserListComponent, isStandalone: true, selector: "axp-app-chooser-list", ngImport: i0, template: "<div class=\" ax-w-full ax-overflow-auto ax-max-h-[300px] ax-pe-2\">\n @for(application of (applications$ | async); track $index){\n <div class=\"ax-flex ax-gap-2 ax-justify-between ax-border-b last:ax-border-b-0 ax-py-3 ax-items-start ax-cursor-pointer\"\n (click)=\"chooseApplication(application)\">\n <div class=\"ax-flex ax-flex-1 ax-gap-2 ax-items-center ax-justify-center ax-font-medium\">\n <div\n class=\"ax-w-12 ax-h-12 ax-flex ax-justify-center ax-items-center ax-rounded-full ax-bg-neutral-100 ax-m-auto\">\n <ax-icon class=\"fa-solid fa-computer ax-text-neutral-500 ax-text-lg\"> </ax-icon>\n <!-- TODO: logo instead of application icon -->\n <!-- <axp-logo [source]=\"application.logo\" [attr.alt]=\"application.title\"\n class=\"!ax-flex ax-items-center ax-justify-center !ax-text-sm ax-mx-auto ax-w-10 ax-h-10 ax-bg-neutral-200 ax-rounded-full\"></axp-logo> -->\n </div>\n <span class=\"ax-flex-1 ax-text-start md:ax-text-base ax-text-sm\">{{ application.title }}</span>\n <span class=\"ax-text-gray-500 md:ax-text-sm ax-text-xs\">{{application.editionName}}</span>\n @if(application.name===selectedApplication?.name){\n <ax-loading></ax-loading>\n }@else {\n <ax-icon class=\"fa-solid fa-chevron-right ax-text-neutral-400\"> </ax-icon>\n }\n </div>\n </div>\n }\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i2.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "pipe", type:
|
171
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: AXPAppChooserListComponent, isStandalone: true, selector: "axp-app-chooser-list", ngImport: i0, template: "<div class=\" ax-w-full ax-overflow-auto ax-max-h-[300px] ax-pe-2\">\n @for(application of (applications$ | async); track $index){\n <div class=\"ax-flex ax-gap-2 ax-justify-between ax-border-b last:ax-border-b-0 ax-py-3 ax-items-start ax-cursor-pointer\"\n (click)=\"chooseApplication(application)\">\n <div class=\"ax-flex ax-flex-1 ax-gap-2 ax-items-center ax-justify-center ax-font-medium\">\n <div\n class=\"ax-w-12 ax-h-12 ax-flex ax-justify-center ax-items-center ax-rounded-full ax-bg-neutral-100 ax-m-auto\">\n <ax-icon class=\"fa-solid fa-computer ax-text-neutral-500 ax-text-lg\"> </ax-icon>\n <!-- TODO: logo instead of application icon -->\n <!-- <axp-logo [source]=\"application.logo\" [attr.alt]=\"application.title\"\n class=\"!ax-flex ax-items-center ax-justify-center !ax-text-sm ax-mx-auto ax-w-10 ax-h-10 ax-bg-neutral-200 ax-rounded-full\"></axp-logo> -->\n </div>\n <span class=\"ax-flex-1 ax-text-start md:ax-text-base ax-text-sm\">{{ application.title }}</span>\n <span class=\"ax-text-gray-500 md:ax-text-sm ax-text-xs\">{{application.editionName}}</span>\n @if(application.name===selectedApplication?.name){\n <ax-loading></ax-loading>\n }@else {\n <ax-icon class=\"fa-solid fa-chevron-right ax-text-neutral-400\"> </ax-icon>\n }\n </div>\n </div>\n }\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i2.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
|
188
172
|
}
|
189
173
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPAppChooserListComponent, decorators: [{
|
190
174
|
type: Component,
|
@@ -195,20 +179,16 @@ class AXMAppChooserSlotComponent {
|
|
195
179
|
constructor() {
|
196
180
|
this.sessionService = inject(AXPSessionService);
|
197
181
|
this.homePageService = inject(AXPHomePageService);
|
198
|
-
this.authStrategyRegistry = inject(AXPAuthStrategyRegistryService);
|
199
|
-
this.oidcStrategy = this.authStrategyRegistry.get('oidc');
|
200
182
|
this.tenant$ = this.sessionService.tenant$;
|
201
183
|
this.application$ = this.sessionService.application$;
|
202
184
|
this.applications$ = of([]);
|
203
185
|
}
|
204
186
|
async chooseApplication(item) {
|
205
|
-
|
206
|
-
|
207
|
-
this.oidcStrategy.startAuthorizationFlow(tenantId, item.id);
|
208
|
-
}
|
187
|
+
await this.sessionService.setApplication(item);
|
188
|
+
await this.homePageService.navigateTo();
|
209
189
|
}
|
210
190
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMAppChooserSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
211
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: AXMAppChooserSlotComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@if(((applications$ | async)?.length ?? 0) > 1) {\n<ax-button color=\"default\" look=\"blank\" #appChooser>\n <ax-icon>\n <i class=\"fa-solid fa-grid-2 ax-text-slate-400 dark:ax-text-slate-200\"></i>\n </ax-icon>\n</ax-button>\n<ax-popover [target]=\"appChooser\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" [adaptivityEnabled]=\"true\">\n <div class=\"ax-bg-lightest ax-border ax-overflow-hidden ax-rounded-md ax-shadow-md ax-w-full ax-min-w-64 ax-p-3\">\n <axp-app-chooser-list></axp-app-chooser-list>\n </div>\n</ax-popover>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i2$2.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: AXPAppChooserListComponent, selector: "axp-app-chooser-list" }, { kind: "pipe", type:
|
191
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: AXMAppChooserSlotComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@if(((applications$ | async)?.length ?? 0) > 1) {\n<ax-button color=\"default\" look=\"blank\" #appChooser>\n <ax-icon>\n <i class=\"fa-solid fa-grid-2 ax-text-slate-400 dark:ax-text-slate-200\"></i>\n </ax-icon>\n</ax-button>\n<ax-popover [target]=\"appChooser\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" [adaptivityEnabled]=\"true\">\n <div class=\"ax-bg-lightest ax-border ax-overflow-hidden ax-rounded-md ax-shadow-md ax-w-full ax-min-w-64 ax-p-3\">\n <axp-app-chooser-list></axp-app-chooser-list>\n </div>\n</ax-popover>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i2$2.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: AXPAppChooserListComponent, selector: "axp-app-chooser-list" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
|
212
192
|
}
|
213
193
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMAppChooserSlotComponent, decorators: [{
|
214
194
|
type: Component,
|
@@ -226,7 +206,7 @@ class AXPTenantChooserDropdownComponent {
|
|
226
206
|
this.router.navigate(['/auth/account/tenant-chooser']);
|
227
207
|
}
|
228
208
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPTenantChooserDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
229
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: AXPTenantChooserDropdownComponent, isStandalone: true, selector: "axp-tenant-chooser-dropdown", ngImport: i0, template: "<!-- <ng-container *ngIf=\"tenants$ | async as tenants\">\n@if(tenants.length>1){\n <div (click)=\"tenantChooser()\"\n class=\"ax-flex ax-items-center ax-border ax-rounded-full ax-px-4 ax-py-1 ax-gap-2 ax-cursor-pointer\">\n <ax-icon class=\"fa-solid fa-building ax-text-neutral-500 ax-text-xs\"></ax-icon>\n <p class=\"ax-text-neutral-500 ax-text-sm ax-font-medium\">\n {{ tenant?.title }}\n </p>\n <ax-icon class=\"fa-regular fa-chevron-down ax-text-neutral-400\"></ax-icon>\n </div>\n }@else {\n <div class=\"ax-flex ax-items-center ax-border ax-rounded-full ax-px-4 ax-py-1 ax-gap-2 ax-cursor-pointer\">\n <ax-icon class=\"fa-solid fa-building ax-text-neutral-500\"></ax-icon>\n <p class=\"ax-text-neutral-500 ax-text-sm ax-font-medium\">\n {{ tenant?.title }}\n </p>\n </div>\n}\n</ng-container> -->\n\n@if (tenants$ | async; as tenants) {\n <ax-button [text]=\"tenant?.title ?? ''\" class=\"ax-xs\" look=\"blank\">\n @if(tenants.length > 1){\n <ax-suffix>\n <ax-icon class=\"fa-solid fa-caret-down\"></ax-icon>\n </ax-suffix>\n }\n </ax-button>\n}", dependencies: [{ kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXChipsModule }, { kind: "ngmodule", type: AXTagModule }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "pipe", type:
|
209
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: AXPTenantChooserDropdownComponent, isStandalone: true, selector: "axp-tenant-chooser-dropdown", ngImport: i0, template: "<!-- <ng-container *ngIf=\"tenants$ | async as tenants\">\n@if(tenants.length>1){\n <div (click)=\"tenantChooser()\"\n class=\"ax-flex ax-items-center ax-border ax-rounded-full ax-px-4 ax-py-1 ax-gap-2 ax-cursor-pointer\">\n <ax-icon class=\"fa-solid fa-building ax-text-neutral-500 ax-text-xs\"></ax-icon>\n <p class=\"ax-text-neutral-500 ax-text-sm ax-font-medium\">\n {{ tenant?.title }}\n </p>\n <ax-icon class=\"fa-regular fa-chevron-down ax-text-neutral-400\"></ax-icon>\n </div>\n }@else {\n <div class=\"ax-flex ax-items-center ax-border ax-rounded-full ax-px-4 ax-py-1 ax-gap-2 ax-cursor-pointer\">\n <ax-icon class=\"fa-solid fa-building ax-text-neutral-500\"></ax-icon>\n <p class=\"ax-text-neutral-500 ax-text-sm ax-font-medium\">\n {{ tenant?.title }}\n </p>\n </div>\n}\n</ng-container> -->\n\n@if (tenants$ | async; as tenants) {\n <ax-button [text]=\"tenant?.title ?? ''\" class=\"ax-xs\" look=\"blank\">\n @if(tenants.length > 1){\n <ax-suffix>\n <ax-icon class=\"fa-solid fa-caret-down\"></ax-icon>\n </ax-suffix>\n }\n </ax-button>\n}", dependencies: [{ kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXChipsModule }, { kind: "ngmodule", type: AXTagModule }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
|
230
210
|
}
|
231
211
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPTenantChooserDropdownComponent, decorators: [{
|
232
212
|
type: Component,
|
@@ -259,21 +239,12 @@ class AXMAuthProfileSlotComponent {
|
|
259
239
|
handleSignIn() {
|
260
240
|
this.router.navigate(['/auth/login']);
|
261
241
|
}
|
262
|
-
async openUserSession() {
|
263
|
-
const com = await import('./acorex-modules-auth-user-sessions.component-8wwWI0cQ.mjs').then((c) => c.AXMUserSessionsComponent);
|
264
|
-
this.popupService.open(com, {
|
265
|
-
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'sm',
|
266
|
-
title: await this.translateService.translateAsync('profile.sessions.title', {
|
267
|
-
scope: 'auth',
|
268
|
-
}),
|
269
|
-
});
|
270
|
-
}
|
271
242
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMAuthProfileSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
272
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: AXMAuthProfileSlotComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "profilePopover", first: true, predicate: ["profilePopover"], descendants: true }], ngImport: i0, template: "@if(
|
243
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: AXMAuthProfileSlotComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "profilePopover", first: true, predicate: ["profilePopover"], descendants: true }], ngImport: i0, template: "@if (isAuthenticated$ | async) {\n <div class=\"ax-size-fit\">\n <div #avatar>\n <axp-user-avatar [size]=\"36\" [userId]=\"(user$ | async)?.id!\"></axp-user-avatar>\n </div>\n\n <ax-popover [target]=\"avatar\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" #p>\n <div class=\"ax-bg-lightest ax-border ax-border-lightest ax-rounded-md ax-shadow-md ax-w-full ax-min-w-64\">\n <div class=\"ax-flex ax-flex-col ax-items-center ax-p-4 ax-border-b\">\n <axp-user-avatar [size]=\"64\" [userId]=\"(user$ | async)?.id!\"></axp-user-avatar>\n\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center ax-mt-2\">\n <div class=\"ax-text-base ax-font-bold\">{{ (user$ | async)?.title }}</div>\n <axp-tenant-chooser-dropdown></axp-tenant-chooser-dropdown>\n </div>\n </div>\n <div class=\"axp-profile-slot-menus\">\n <ul>\n <li>\n <a (click)=\"editProfile()\">\n <i class=\"fa-light fa-user\"></i>\n <span>{{ 'profile.edit' | translate: { scope: 'auth' } | async }}</span>\n </a>\n </li>\n <li>\n <a (click)=\"p.close()\" [routerLink]=\"['/', appName(), 'settings', 'user']\">\n <i class=\"fa-light fa-gear\"></i>\n <span>{{ 'profile.settings' | translate: { scope: 'auth' } | async }}</span>\n </a>\n </li>\n <!-- <li>\n <a (click)=\"openUserSession()\">\n <i class=\"fa-light fa-mobile\"></i>\n <span>{{ 'profile.sessions' | translate : { scope: 'auth' } | async }}</span>\n </a>\n </li> -->\n <li class=\"ax-text-danger-500\">\n <a (click)=\"logOut()\">\n <i class=\"fa-light fa-arrow-right-from-bracket\"></i>\n <span>{{ 'profile.logout' | translate: { scope: 'auth' } | async }}</span>\n </a>\n </li>\n </ul>\n </div>\n </div>\n </ax-popover>\n </div>\n} @else {\n <ax-button color=\"default\" look=\"blank\" text=\"Sign Up / Sign In\" (click)=\"handleSignIn()\">\n <ax-icon>\n <i class=\"fa-solid fa-user ax-text-slate-400 dark:ax-text-slate-200\"></i>\n </ax-icon>\n </ax-button>\n}\n", styles: [".axp-profile-slot-menus ul{margin-top:.5rem;border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1));padding-left:.5rem;padding-right:.5rem}.axp-profile-slot-menus ul:last-child{border-width:0px}.axp-profile-slot-menus ul li{display:flex;cursor:pointer;border-radius:.375rem}.axp-profile-slot-menus ul li:last-child{margin-bottom:.5rem}.axp-profile-slot-menus ul li:hover{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-dark-surface),var(--tw-bg-opacity, 1))}.axp-profile-slot-menus ul li i{margin-inline-end:.75rem;display:grid;height:1.5rem;width:1.5rem;place-items:center;font-size:1.25rem;line-height:1.75rem}.axp-profile-slot-menus ul li a{display:flex;height:100%;width:100%;align-items:center;padding:.5rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type:
|
273
244
|
//
|
274
245
|
AXImageModule }, { kind: "ngmodule", type: AXAvatarModule }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i2$2.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPUserAvatarComponent, selector: "axp-user-avatar", inputs: ["size", "userId"] }, { kind: "component", type:
|
275
246
|
//
|
276
|
-
AXPTenantChooserDropdownComponent, selector: "axp-tenant-chooser-dropdown" }, { kind: "pipe", type:
|
247
|
+
AXPTenantChooserDropdownComponent, selector: "axp-tenant-chooser-dropdown" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
277
248
|
}
|
278
249
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMAuthProfileSlotComponent, decorators: [{
|
279
250
|
type: Component,
|
@@ -291,7 +262,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
291
262
|
AXPUserAvatarComponent,
|
292
263
|
//
|
293
264
|
AXPTenantChooserDropdownComponent,
|
294
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@if(
|
265
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@if (isAuthenticated$ | async) {\n <div class=\"ax-size-fit\">\n <div #avatar>\n <axp-user-avatar [size]=\"36\" [userId]=\"(user$ | async)?.id!\"></axp-user-avatar>\n </div>\n\n <ax-popover [target]=\"avatar\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" #p>\n <div class=\"ax-bg-lightest ax-border ax-border-lightest ax-rounded-md ax-shadow-md ax-w-full ax-min-w-64\">\n <div class=\"ax-flex ax-flex-col ax-items-center ax-p-4 ax-border-b\">\n <axp-user-avatar [size]=\"64\" [userId]=\"(user$ | async)?.id!\"></axp-user-avatar>\n\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center ax-mt-2\">\n <div class=\"ax-text-base ax-font-bold\">{{ (user$ | async)?.title }}</div>\n <axp-tenant-chooser-dropdown></axp-tenant-chooser-dropdown>\n </div>\n </div>\n <div class=\"axp-profile-slot-menus\">\n <ul>\n <li>\n <a (click)=\"editProfile()\">\n <i class=\"fa-light fa-user\"></i>\n <span>{{ 'profile.edit' | translate: { scope: 'auth' } | async }}</span>\n </a>\n </li>\n <li>\n <a (click)=\"p.close()\" [routerLink]=\"['/', appName(), 'settings', 'user']\">\n <i class=\"fa-light fa-gear\"></i>\n <span>{{ 'profile.settings' | translate: { scope: 'auth' } | async }}</span>\n </a>\n </li>\n <!-- <li>\n <a (click)=\"openUserSession()\">\n <i class=\"fa-light fa-mobile\"></i>\n <span>{{ 'profile.sessions' | translate : { scope: 'auth' } | async }}</span>\n </a>\n </li> -->\n <li class=\"ax-text-danger-500\">\n <a (click)=\"logOut()\">\n <i class=\"fa-light fa-arrow-right-from-bracket\"></i>\n <span>{{ 'profile.logout' | translate: { scope: 'auth' } | async }}</span>\n </a>\n </li>\n </ul>\n </div>\n </div>\n </ax-popover>\n </div>\n} @else {\n <ax-button color=\"default\" look=\"blank\" text=\"Sign Up / Sign In\" (click)=\"handleSignIn()\">\n <ax-icon>\n <i class=\"fa-solid fa-user ax-text-slate-400 dark:ax-text-slate-200\"></i>\n </ax-icon>\n </ax-button>\n}\n", styles: [".axp-profile-slot-menus ul{margin-top:.5rem;border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-border-lightest-surface),var(--tw-border-opacity, 1));padding-left:.5rem;padding-right:.5rem}.axp-profile-slot-menus ul:last-child{border-width:0px}.axp-profile-slot-menus ul li{display:flex;cursor:pointer;border-radius:.375rem}.axp-profile-slot-menus ul li:last-child{margin-bottom:.5rem}.axp-profile-slot-menus ul li:hover{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-dark-surface),var(--tw-bg-opacity, 1))}.axp-profile-slot-menus ul li i{margin-inline-end:.75rem;display:grid;height:1.5rem;width:1.5rem;place-items:center;font-size:1.25rem;line-height:1.75rem}.axp-profile-slot-menus ul li a{display:flex;height:100%;width:100%;align-items:center;padding:.5rem}\n"] }]
|
295
266
|
}], propDecorators: { profilePopover: [{
|
296
267
|
type: ViewChild,
|
297
268
|
args: ['profilePopover']
|
@@ -385,162 +356,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
385
356
|
args: ['profilePopover']
|
386
357
|
}] } });
|
387
358
|
|
388
|
-
class AXPIdleService {
|
389
|
-
constructor() {
|
390
|
-
this.configs = inject(AXM_AUTH_CONFIG_TOKEN);
|
391
|
-
this.idle$ = new Subject();
|
392
|
-
this.timeoutDuration = this.configs.idleTimeout ?? 10 * 60 * 1000;
|
393
|
-
this.userActivity$ = new Subject();
|
394
|
-
this.idleSubscription = null;
|
395
|
-
this.setupActivityListeners();
|
396
|
-
}
|
397
|
-
get idleState$() {
|
398
|
-
return this.idle$.asObservable();
|
399
|
-
}
|
400
|
-
setupActivityListeners() {
|
401
|
-
const activityEvents = ['mousemove', 'keydown', 'wheel'];
|
402
|
-
activityEvents.forEach(event => document.addEventListener(event, () => this.resetTimer()));
|
403
|
-
}
|
404
|
-
startWatching() {
|
405
|
-
this.stopWatching(); // Stop any existing subscription
|
406
|
-
this.idleSubscription = this.userActivity$.pipe(startWith(null), switchMap(() => timer(this.timeoutDuration)), tap(() => this.idle$.next())).subscribe();
|
407
|
-
}
|
408
|
-
resetTimer() {
|
409
|
-
this.userActivity$.next();
|
410
|
-
}
|
411
|
-
stopWatching() {
|
412
|
-
if (this.idleSubscription) {
|
413
|
-
this.idleSubscription.unsubscribe();
|
414
|
-
this.idleSubscription = null;
|
415
|
-
}
|
416
|
-
}
|
417
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPIdleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
418
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPIdleService, providedIn: 'root' }); }
|
419
|
-
}
|
420
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPIdleService, decorators: [{
|
421
|
-
type: Injectable,
|
422
|
-
args: [{ providedIn: 'root' }]
|
423
|
-
}], ctorParameters: () => [] });
|
424
|
-
|
425
|
-
class AXMDeviceSessionsService extends AXMEntityCrudServiceImpl {
|
426
|
-
}
|
427
|
-
class AXMDeviceSessionsServiceImpl extends AXMDeviceSessionsService {
|
428
|
-
// private aXMAuthConfigs: AXMAuthConfigs = inject(AXM_AUTH_CONFIG_TOKEN);
|
429
|
-
constructor(http) {
|
430
|
-
super('auth.deviceSessions'); // TODO: Update with correct RootConfig if needed
|
431
|
-
this.http = http;
|
432
|
-
}
|
433
|
-
terminate(id) {
|
434
|
-
throw new Error('Method not implemented.');
|
435
|
-
}
|
436
|
-
async terminateAllCurrentUserSessions() {
|
437
|
-
return (this.http
|
438
|
-
.post('' + '/api/security-management/device-sessions/Terminate-All', {})
|
439
|
-
.pipe(map((t) => (t === undefined ? false : t)))
|
440
|
-
.toPromise() ?? false);
|
441
|
-
}
|
442
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMDeviceSessionsServiceImpl, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
443
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMDeviceSessionsServiceImpl }); }
|
444
|
-
}
|
445
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMDeviceSessionsServiceImpl, decorators: [{
|
446
|
-
type: Injectable
|
447
|
-
}], ctorParameters: () => [{ type: i1$3.HttpClient }] });
|
448
|
-
|
449
|
-
class AXMUserDeviceSessionsService {
|
450
|
-
}
|
451
|
-
class AXMUserDeviceSessionsServiceImp extends AXMUserDeviceSessionsService {
|
452
|
-
constructor() {
|
453
|
-
super(); // Call the base class constructor (good practice)
|
454
|
-
this.sessionService = inject(AXPSessionService);
|
455
|
-
this.deviceSessionsService = inject(AXMDeviceSessionsService);
|
456
|
-
this.settingService = inject(AXPSettingService);
|
457
|
-
}
|
458
|
-
async getSessions() {
|
459
|
-
const userId = this.sessionService.user?.id;
|
460
|
-
if (!userId) {
|
461
|
-
return [];
|
462
|
-
}
|
463
|
-
const response = await this.deviceSessionsService.query();
|
464
|
-
const items = response.items.filter((item) => item.userId === userId && String(item.status).toLowerCase() === 'active' && !item.isActiveSession);
|
465
|
-
return items;
|
466
|
-
}
|
467
|
-
async getCurrentActiveSessions() {
|
468
|
-
const userId = this.sessionService.user?.id;
|
469
|
-
const response = await this.deviceSessionsService.query();
|
470
|
-
const activeSession = response.items.find((item) => item.userId === userId && String(item.status).toLowerCase() === 'active' && item.isActiveSession);
|
471
|
-
return activeSession;
|
472
|
-
}
|
473
|
-
async terminateSession(sessionId) {
|
474
|
-
await this.deviceSessionsService.updateOne(sessionId, { status: 'revoked' });
|
475
|
-
}
|
476
|
-
async terminateAllSession() {
|
477
|
-
await this.deviceSessionsService.terminateAllCurrentUserSessions();
|
478
|
-
}
|
479
|
-
async setTokenLifetimeMinutes(value) {
|
480
|
-
await this.settingService.scope(AXPPlatformScope.User).set('session-timeout', value);
|
481
|
-
let s2 = await this.settingService.scope(AXPPlatformScope.User).get('session-timeout');
|
482
|
-
}
|
483
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMUserDeviceSessionsServiceImp, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
484
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMUserDeviceSessionsServiceImp }); }
|
485
|
-
}
|
486
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMUserDeviceSessionsServiceImp, decorators: [{
|
487
|
-
type: Injectable
|
488
|
-
}], ctorParameters: () => [] });
|
489
|
-
|
490
359
|
const canActivateTenantChooser = async (route, state) => {
|
491
360
|
const sessionService = inject(AXPSessionService);
|
492
361
|
const router = inject(Router);
|
493
|
-
const authStrategyRegistry = inject(AXPAuthStrategyRegistryService);
|
494
|
-
const oidcStrategy = authStrategyRegistry.get('oidc');
|
495
362
|
const tenants = await firstValueFrom(sessionService.tenants$);
|
496
|
-
if (tenants.length
|
497
|
-
window.alert('You do not have any tenant assigned to your account and cannot use the site. Please contact your administrator.');
|
363
|
+
if (tenants.length == 0) {
|
498
364
|
return router.createUrlTree(['/auth/login']);
|
499
365
|
}
|
500
|
-
if (tenants.length
|
501
|
-
|
502
|
-
|
503
|
-
}
|
504
|
-
return false;
|
366
|
+
if (tenants.length == 1) {
|
367
|
+
await sessionService.setTenant(tenants[0]);
|
368
|
+
return router.createUrlTree(['/auth/account/app-chooser']);
|
505
369
|
}
|
506
370
|
return true;
|
507
371
|
};
|
508
|
-
|
509
372
|
const canActivateAppChooser = async (route, state) => {
|
510
373
|
const sessionService = inject(AXPSessionService);
|
511
374
|
const homePageService = inject(AXPHomePageService);
|
512
375
|
const router = inject(Router);
|
513
|
-
const authStrategyRegistry = inject(AXPAuthStrategyRegistryService);
|
514
|
-
const oidcStrategy = authStrategyRegistry.get('oidc');
|
515
376
|
const apps = await firstValueFrom(sessionService.applications$);
|
516
|
-
if (apps.length
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
if (!tenantId) {
|
523
|
-
throw new Error('Tenant ID is missing. Please contact support.');
|
524
|
-
}
|
525
|
-
if (oidcStrategy && typeof oidcStrategy.startAuthorizationFlow === 'function') {
|
526
|
-
await oidcStrategy.startAuthorizationFlow(tenantId, apps[0].id);
|
527
|
-
}
|
528
|
-
return false;
|
377
|
+
if (apps.length == 0) {
|
378
|
+
return router.createUrlTree(['/auth/login']);
|
379
|
+
}
|
380
|
+
if (apps.length == 1) {
|
381
|
+
await sessionService.setApplication(apps[0]);
|
382
|
+
return router.createUrlTree([homePageService.getCurrent().path]);
|
529
383
|
}
|
530
384
|
return true;
|
531
385
|
};
|
532
|
-
|
533
386
|
function routesFacory() {
|
534
387
|
let routes = [];
|
535
388
|
routes = [
|
536
389
|
{
|
537
390
|
path: 'tenant-chooser',
|
538
|
-
loadComponent: () => import('./acorex-modules-auth-tenant-chooser.component-
|
391
|
+
loadComponent: () => import('./acorex-modules-auth-tenant-chooser.component-B1aE-TOD.mjs').then((c) => c.AXPAuthTenantChooserComponent),
|
539
392
|
canActivate: [AXPAuthGuard, canActivateTenantChooser],
|
540
393
|
},
|
541
394
|
{
|
542
395
|
path: 'app-chooser',
|
543
|
-
loadComponent: () => import('./acorex-modules-auth-app-chooser.component-
|
396
|
+
loadComponent: () => import('./acorex-modules-auth-app-chooser.component-Cpy0VN6n.mjs').then((c) => c.AXPAuthAppChooserComponent),
|
544
397
|
canActivate: [AXPAuthGuard, canActivateAppChooser],
|
545
398
|
},
|
546
399
|
];
|
@@ -548,17 +401,17 @@ function routesFacory() {
|
|
548
401
|
}
|
549
402
|
class AXPAccountModule {
|
550
403
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPAccountModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
551
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: AXPAccountModule, imports: [RouterModule, i1$
|
404
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: AXPAccountModule, imports: [RouterModule, i1$2.AXPComponentSlotModule] }); }
|
552
405
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPAccountModule, providers: [
|
553
406
|
{
|
554
407
|
provide: ROUTES,
|
555
408
|
multi: true,
|
556
409
|
useFactory: routesFacory,
|
557
410
|
},
|
558
|
-
{
|
559
|
-
|
560
|
-
|
561
|
-
},
|
411
|
+
// {
|
412
|
+
// provide: AXMUserDeviceSessionsService,
|
413
|
+
// useClass: AXMUserDeviceSessionsServiceImp,
|
414
|
+
// },
|
562
415
|
], imports: [RouterModule,
|
563
416
|
//
|
564
417
|
AXPComponentSlotModule.forChild({
|
@@ -619,10 +472,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
619
472
|
multi: true,
|
620
473
|
useFactory: routesFacory,
|
621
474
|
},
|
622
|
-
{
|
623
|
-
|
624
|
-
|
625
|
-
},
|
475
|
+
// {
|
476
|
+
// provide: AXMUserDeviceSessionsService,
|
477
|
+
// useClass: AXMUserDeviceSessionsServiceImp,
|
478
|
+
// },
|
626
479
|
],
|
627
480
|
}]
|
628
481
|
}] });
|
@@ -634,7 +487,7 @@ var account_module = /*#__PURE__*/Object.freeze({
|
|
634
487
|
|
635
488
|
class AXMAuthModule {
|
636
489
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
637
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: AXMAuthModule, imports: [CommonModule, i1$
|
490
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.3", ngImport: i0, type: AXMAuthModule, imports: [CommonModule, i1$3.AXPCommonModule, i1$1.RouterModule, AXPAccountModule] }); }
|
638
491
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXMAuthModule, providers: [
|
639
492
|
AXMAuthErrorHandler,
|
640
493
|
{
|
@@ -685,16 +538,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
685
538
|
}]
|
686
539
|
}] });
|
687
540
|
|
688
|
-
|
689
|
-
(
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
541
|
+
class AXPIdleService {
|
542
|
+
constructor() {
|
543
|
+
this.configs = inject(AXM_AUTH_CONFIG_TOKEN);
|
544
|
+
this.idle$ = new Subject();
|
545
|
+
this.timeoutDuration = this.configs.idleTimeout ?? 10 * 60 * 1000;
|
546
|
+
this.userActivity$ = new Subject();
|
547
|
+
this.idleSubscription = null;
|
548
|
+
this.setupActivityListeners();
|
549
|
+
}
|
550
|
+
get idleState$() {
|
551
|
+
return this.idle$.asObservable();
|
552
|
+
}
|
553
|
+
setupActivityListeners() {
|
554
|
+
const activityEvents = ['mousemove', 'keydown', 'wheel'];
|
555
|
+
activityEvents.forEach(event => document.addEventListener(event, () => this.resetTimer()));
|
556
|
+
}
|
557
|
+
startWatching() {
|
558
|
+
this.stopWatching(); // Stop any existing subscription
|
559
|
+
this.idleSubscription = this.userActivity$.pipe(startWith(null), switchMap(() => timer(this.timeoutDuration)), tap(() => this.idle$.next())).subscribe();
|
560
|
+
}
|
561
|
+
resetTimer() {
|
562
|
+
this.userActivity$.next();
|
563
|
+
}
|
564
|
+
stopWatching() {
|
565
|
+
if (this.idleSubscription) {
|
566
|
+
this.idleSubscription.unsubscribe();
|
567
|
+
this.idleSubscription = null;
|
568
|
+
}
|
569
|
+
}
|
570
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPIdleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
571
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPIdleService, providedIn: 'root' }); }
|
572
|
+
}
|
573
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXPIdleService, decorators: [{
|
574
|
+
type: Injectable,
|
575
|
+
args: [{ providedIn: 'root' }]
|
576
|
+
}], ctorParameters: () => [] });
|
694
577
|
|
695
578
|
/**
|
696
579
|
* Generated bundle index. Do not edit.
|
697
580
|
*/
|
698
581
|
|
699
|
-
export { AXM_AUTH_CONFIG_TOKEN as A, AXMAuthenticationTypes as a, AXPTenantChooserDropdownComponent as b, AXPAppChooserListComponent as c,
|
700
|
-
//# sourceMappingURL=acorex-modules-auth-acorex-modules-auth-
|
582
|
+
export { AXM_AUTH_CONFIG_TOKEN as A, AXMAuthenticationTypes as a, AXPTenantChooserDropdownComponent as b, AXPAppChooserListComponent as c, AXMAuthErrorHandler as d, AXMDefaultAuthConfigs as e, configAuthModule as f, AXMAuthModule as g, AXPIdleService as h };
|
583
|
+
//# sourceMappingURL=acorex-modules-auth-acorex-modules-auth-y6rICHrT.mjs.map
|