@acorex-platform/module-auth-client 0.0.18 → 0.0.21
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/fesm2022/{acorex-platform-module-auth-client-acorex-platform-module-auth-client-mW7tx8C0.mjs → acorex-platform-module-auth-client-acorex-platform-module-auth-client-CYmUn-lw.mjs} +940 -608
- package/fesm2022/acorex-platform-module-auth-client-acorex-platform-module-auth-client-CYmUn-lw.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-app-chooser.component-BVbu-f8h.mjs +75 -0
- package/fesm2022/acorex-platform-module-auth-client-app-chooser.component-BVbu-f8h.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-blank.layout-BRGgntib.mjs → acorex-platform-module-auth-client-blank.layout-BCXNPgrp.mjs} +6 -6
- package/fesm2022/acorex-platform-module-auth-client-blank.layout-BCXNPgrp.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-change-password.command-O8Mgxoqj.mjs → acorex-platform-module-auth-client-change-password.command-DIM_d7RO.mjs} +51 -41
- package/fesm2022/acorex-platform-module-auth-client-change-password.command-DIM_d7RO.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-change-photo.command-CYGqrJV0.mjs +257 -0
- package/fesm2022/acorex-platform-module-auth-client-change-photo.command-CYGqrJV0.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-contracts.mjs +46 -10
- package/fesm2022/acorex-platform-module-auth-client-contracts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-edit-account-info.command-B-mVlXxg.mjs → acorex-platform-module-auth-client-edit-account-info.command-CD9IrimO.mjs} +5 -5
- package/fesm2022/acorex-platform-module-auth-client-edit-account-info.command-CD9IrimO.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-edit-signature.command-CcTJJwAX.mjs → acorex-platform-module-auth-client-edit-signature.command-TjOLhvKL.mjs} +5 -5
- package/fesm2022/acorex-platform-module-auth-client-edit-signature.command-TjOLhvKL.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-get-user-activity.query-BTpibxe9.mjs +80 -0
- package/fesm2022/acorex-platform-module-auth-client-get-user-activity.query-BTpibxe9.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-lock-screen.command-PMoJJxe7.mjs → acorex-platform-module-auth-client-lock-screen.command-Br9O4b5c.mjs} +6 -6
- package/fesm2022/acorex-platform-module-auth-client-lock-screen.command-Br9O4b5c.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-login.module-C4S0RjM7.mjs → acorex-platform-module-auth-client-login.module-DJVL3bAF.mjs} +8 -21
- package/fesm2022/acorex-platform-module-auth-client-login.module-DJVL3bAF.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-master.layout-DZUYm22p.mjs +39 -0
- package/fesm2022/acorex-platform-module-auth-client-master.layout-DZUYm22p.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-oauth-callback.component-CEMvfjj4.mjs → acorex-platform-module-auth-client-oauth-callback.component-DnQzPUxF.mjs} +11 -15
- package/fesm2022/acorex-platform-module-auth-client-oauth-callback.component-DnQzPUxF.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-open-sessions.command-LZKM9fgo.mjs +200 -0
- package/fesm2022/acorex-platform-module-auth-client-open-sessions.command-LZKM9fgo.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-password.component-CIr6IBG6.mjs → acorex-platform-module-auth-client-password.component-CNKRWfuG.mjs} +86 -45
- package/fesm2022/acorex-platform-module-auth-client-password.component-CNKRWfuG.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-password.component-CW0t9fEn.mjs +87 -0
- package/fesm2022/acorex-platform-module-auth-client-password.component-CW0t9fEn.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-platform-settings-unavailable.component-BEVkQ3jh.mjs +47 -0
- package/fesm2022/acorex-platform-module-auth-client-platform-settings-unavailable.component-BEVkQ3jh.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-profile-activity-chart.component-DTY1eEI_.mjs → acorex-platform-module-auth-client-profile-activity-chart.component-CtSrYARX.mjs} +38 -46
- package/fesm2022/acorex-platform-module-auth-client-profile-activity-chart.component-CtSrYARX.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-profile-coming-soon.command-DBbFbzAx.mjs → acorex-platform-module-auth-client-profile-coming-soon.command-Crh2GsRA.mjs} +5 -5
- package/fesm2022/acorex-platform-module-auth-client-profile-coming-soon.command-Crh2GsRA.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-C6u3AB4N.mjs → acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-D0QS8joQ.mjs} +18 -13
- package/fesm2022/{acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-C6u3AB4N.mjs.map → acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-D0QS8joQ.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-profile-page-component.provider-Dhmzo4ME.mjs → acorex-platform-module-auth-client-profile-page-component.provider-6lNx6bKI.mjs} +7 -7
- package/fesm2022/{acorex-platform-module-auth-client-profile-page-component.provider-Dhmzo4ME.mjs.map → acorex-platform-module-auth-client-profile-page-component.provider-6lNx6bKI.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-auth-client-profile-page.component-CdxseoJX.mjs +650 -0
- package/fesm2022/acorex-platform-module-auth-client-profile-page.component-CdxseoJX.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-register-password.component-ia6tdvTc.mjs → acorex-platform-module-auth-client-register-password.component-D-tBrCJv.mjs} +15 -14
- package/fesm2022/acorex-platform-module-auth-client-register-password.component-D-tBrCJv.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-register.module--DG9m8iC.mjs → acorex-platform-module-auth-client-register.module-BrXqva0B.mjs} +23 -23
- package/fesm2022/acorex-platform-module-auth-client-register.module-BrXqva0B.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-remove-pin-code.command-qtswigkv.mjs → acorex-platform-module-auth-client-remove-pin-code.command-uK04-h15.mjs} +7 -7
- package/fesm2022/acorex-platform-module-auth-client-remove-pin-code.command-uK04-h15.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-reset-password.component-CcwDb6Wb.mjs +115 -0
- package/fesm2022/acorex-platform-module-auth-client-reset-password.component-CcwDb6Wb.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-result.component-DYJaB-FD.mjs → acorex-platform-module-auth-client-result.component-DWv1hmQR.mjs} +6 -6
- package/fesm2022/acorex-platform-module-auth-client-result.component-DWv1hmQR.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-routes-DVN2Y2Ps.mjs → acorex-platform-module-auth-client-routes-IX2qmeqU.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-auth-client-routes-DVN2Y2Ps.mjs.map → acorex-platform-module-auth-client-routes-IX2qmeqU.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-auth-client-session-lock-overlay.component-BhsTAmVe.mjs +361 -0
- package/fesm2022/acorex-platform-module-auth-client-session-lock-overlay.component-BhsTAmVe.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-set-pin-code.command-BJT7F-xz.mjs +116 -0
- package/fesm2022/acorex-platform-module-auth-client-set-pin-code.command-BJT7F-xz.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-set-pin-code.component-BHVqbYFv.mjs → acorex-platform-module-auth-client-set-pin-code.component-Cq4skm_3.mjs} +29 -20
- package/fesm2022/acorex-platform-module-auth-client-set-pin-code.component-Cq4skm_3.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-settings.provider-n1qbs6e1.mjs → acorex-platform-module-auth-client-settings.provider-Yaoz8yp3.mjs} +139 -11
- package/fesm2022/acorex-platform-module-auth-client-settings.provider-Yaoz8yp3.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-show-profile-command-CxMz1yy-.mjs → acorex-platform-module-auth-client-show-profile-command-BWoDxIdx.mjs} +5 -6
- package/fesm2022/acorex-platform-module-auth-client-show-profile-command-BWoDxIdx.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-signout-command-DqqrP5pk.mjs → acorex-platform-module-auth-client-signout-command-B7n_Fn4P.mjs} +5 -5
- package/fesm2022/acorex-platform-module-auth-client-signout-command-B7n_Fn4P.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-tenant-chooser.component-CHmg7D5H.mjs +67 -0
- package/fesm2022/acorex-platform-module-auth-client-tenant-chooser.component-CHmg7D5H.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-two-factor-code.component-nsB4v25Z.mjs +40 -0
- package/fesm2022/acorex-platform-module-auth-client-two-factor-code.component-nsB4v25Z.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-two-factor.module-FAqKbmBb.mjs → acorex-platform-module-auth-client-two-factor.module-_jYo6xXr.mjs} +8 -11
- package/fesm2022/acorex-platform-module-auth-client-two-factor.module-_jYo6xXr.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-view-login-history.command-B42BHIAL.mjs → acorex-platform-module-auth-client-view-login-history.command-ovj5rdHL.mjs} +13 -11
- package/fesm2022/acorex-platform-module-auth-client-view-login-history.command-ovj5rdHL.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client.mjs +1 -1
- package/package.json +1 -1
- package/types/acorex-platform-module-auth-client-contracts.d.ts +43 -9
- package/types/acorex-platform-module-auth-client.d.ts +63 -56
- package/fesm2022/acorex-platform-module-auth-client-acorex-platform-module-auth-client-mW7tx8C0.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-app-chooser.component-IPLp1kVv.mjs +0 -67
- package/fesm2022/acorex-platform-module-auth-client-app-chooser.component-IPLp1kVv.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-blank.layout-BRGgntib.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-change-password.command-O8Mgxoqj.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-change-photo.command-BcNq9mTU.mjs +0 -192
- package/fesm2022/acorex-platform-module-auth-client-change-photo.command-BcNq9mTU.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-edit-account-info.command-B-mVlXxg.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-edit-signature.command-CcTJJwAX.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-lock-screen.command-PMoJJxe7.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-login.module-C4S0RjM7.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-master.layout-DXwb5VSr.mjs +0 -24
- package/fesm2022/acorex-platform-module-auth-client-master.layout-DXwb5VSr.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-oauth-callback.component-CEMvfjj4.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-open-sessions.command-BsS9b6Xk.mjs +0 -196
- package/fesm2022/acorex-platform-module-auth-client-open-sessions.command-BsS9b6Xk.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-password.component-CIr6IBG6.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-password.component-DnFItGdA.mjs +0 -88
- package/fesm2022/acorex-platform-module-auth-client-password.component-DnFItGdA.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-profile-activity-chart.component-DTY1eEI_.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-profile-coming-soon.command-DBbFbzAx.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-profile-page.component-CJ9AA3ZN.mjs +0 -446
- package/fesm2022/acorex-platform-module-auth-client-profile-page.component-CJ9AA3ZN.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-register-password.component-ia6tdvTc.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-register.module--DG9m8iC.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-remove-pin-code.command-qtswigkv.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-reset-password.component-CTlrt_18.mjs +0 -115
- package/fesm2022/acorex-platform-module-auth-client-reset-password.component-CTlrt_18.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-result.component-DYJaB-FD.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-session-lock-overlay.component-CN1JqPBW.mjs +0 -346
- package/fesm2022/acorex-platform-module-auth-client-session-lock-overlay.component-CN1JqPBW.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-set-pin-code.command-mBEdso1T.mjs +0 -33
- package/fesm2022/acorex-platform-module-auth-client-set-pin-code.command-mBEdso1T.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-set-pin-code.component-BHVqbYFv.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-settings.provider-n1qbs6e1.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-show-profile-command-CxMz1yy-.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-signout-command-DqqrP5pk.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-tenant-chooser.component-B_9s4F36.mjs +0 -59
- package/fesm2022/acorex-platform-module-auth-client-tenant-chooser.component-B_9s4F36.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-two-factor-code.component-DAxlYlhM.mjs +0 -40
- package/fesm2022/acorex-platform-module-auth-client-two-factor-code.component-DAxlYlhM.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-two-factor.module-FAqKbmBb.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-view-login-history.command-B42BHIAL.mjs.map +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
-
import * as i1 from '@acorex/components/avatar';
|
|
4
|
-
import { AXAvatarModule } from '@acorex/components/avatar';
|
|
5
|
-
import { AXButtonModule } from '@acorex/components/button';
|
|
6
|
-
import { AXCheckBoxModule } from '@acorex/components/check-box';
|
|
7
|
-
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
8
|
-
import { AXFormModule } from '@acorex/components/form';
|
|
9
|
-
import { AXImageModule } from '@acorex/components/image';
|
|
10
|
-
import { AXLabelModule } from '@acorex/components/label';
|
|
11
|
-
import { AXLoadingModule } from '@acorex/components/loading';
|
|
12
|
-
import { AXTextBoxModule } from '@acorex/components/text-box';
|
|
13
|
-
import * as i7 from '@acorex/core/translation';
|
|
14
|
-
import { AXTranslationModule } from '@acorex/core/translation';
|
|
15
|
-
import { AXPSessionService } from '@acorex-platform/framework-client/auth';
|
|
16
|
-
import { AXP_PLATFORM_CONFIG_TOKEN } from '@acorex-platform/framework-client/common';
|
|
17
|
-
import { AXPLogoComponent } from '@acorex-platform/framework-client/core';
|
|
18
|
-
import { AXPUserAvatarComponent } from '@acorex-platform/framework-client/layout/components';
|
|
19
|
-
import * as i6 from '@angular/common';
|
|
20
|
-
import { CommonModule } from '@angular/common';
|
|
21
|
-
import { Router } from '@angular/router';
|
|
22
|
-
import { s as AXPTenantChooserDropdownComponent, t as AXPAppChooserListComponent } from './acorex-platform-module-auth-client-acorex-platform-module-auth-client-mW7tx8C0.mjs';
|
|
23
|
-
|
|
24
|
-
class AXPAuthAppChooserComponent {
|
|
25
|
-
constructor() {
|
|
26
|
-
this.router = inject(Router);
|
|
27
|
-
this.platformConfig = inject(AXP_PLATFORM_CONFIG_TOKEN);
|
|
28
|
-
this.sessionService = inject(AXPSessionService);
|
|
29
|
-
this.user = this.sessionService.user;
|
|
30
|
-
this.tenants$ = this.sessionService.tenants$;
|
|
31
|
-
this.tenant = this.sessionService.tenant;
|
|
32
|
-
}
|
|
33
|
-
ngOnInit() {
|
|
34
|
-
}
|
|
35
|
-
tenantChooser() {
|
|
36
|
-
this.router.navigate(['/auth/account/tenant-chooser']);
|
|
37
|
-
}
|
|
38
|
-
async handleSignout() {
|
|
39
|
-
await this.sessionService.signout();
|
|
40
|
-
this.router.navigate(['/auth/login']);
|
|
41
|
-
}
|
|
42
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthAppChooserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
43
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPAuthAppChooserComponent, isStandalone: true, selector: "axp-auth-app-chooser", ngImport: i0, template: "<main\n *translate=\"let t\"\n class=\"w-full space-y-10 h-[100vh] flex flex-col items-center justify-center bg-lightest md:bg-default\"\n>\n <section>\n <axp-logo\n logoKey=\"platform\"\n appearance=\"onLight\"\n format=\"full\"\n [size]=\"160\"\n [attr.alt]=\"platformConfig.title\"\n class=\"w-36 mx-auto text-2xl font-bold\"\n ></axp-logo>\n </section>\n <section class=\"flex justify-center\">\n <div\n class=\"flex gap-2 justify-center text-center flex-col items-center border rounded-lg shadow-lg p-6 lg:w-[45vw] xl:w-[25vw] w-[90vw]\"\n >\n <ax-avatar class=\"rounded-full\" [size]=\"72\">\n @if (user?.avatar) {\n <axp-user-avatar [size]=\"72\" [userId]=\"user?.id!\"></axp-user-avatar>\n }\n </ax-avatar>\n <h2 class=\"md:text-lg font-medium\">\n {{ '@auth:welcome.message' | translate | async }}, {{ user?.title }}\n </h2>\n <axp-tenant-chooser-dropdown></axp-tenant-chooser-dropdown>\n <p class=\"text-neutral-500 text-sm md:text-base font-medium\">\n {{ '@auth:application-chooser.description' | translate | async }}\n </p>\n <div class=\"mt-3 w-full overflow-auto max-h-[300px]\">\n <axp-app-chooser-list></axp-app-chooser-list>\n </div>\n </div>\n </section>\n <section>\n <p class=\"text-neutral-400 text-sm\">\n {{ '@auth:application-chooser.footer' | translate | async }}\n @if (tenants$ | async; as tenants) {\n @if (tenants.length > 1) {\n <a\n (click)=\"tenantChooser()\"\n class=\"text-primary-500 cursor-pointer font-medium hover:underline\"\n >\n {{ '@auth:application-chooser.backCompany' | translate | async }}\n </a>\n } @else {\n <a\n (click)=\"handleSignout()\"\n class=\"text-primary-500 font-medium cursor-pointer hover:underline\"\n >\n {{ '@auth:backLogin' | translate | async }}\n </a>\n }\n }\n </p>\n </section>\n</main>\n", styles: [".gradient{background:-webkit-linear-gradient(var(--ax-current-v1),var(--ax-current-v2));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXLabelModule }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "ngmodule", type: AXAvatarModule }, { kind: "component", type: i1.AXAvatarComponent, selector: "ax-avatar", inputs: ["color", "size", "shape", "look"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: AXImageModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: AXPLogoComponent, selector: "axp-logo", inputs: ["logoKey", "appearance", "size", "format"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i7.AXTranslatorDirective, selector: "[translate]" }, { kind: "component", type: AXPTenantChooserDropdownComponent, selector: "axp-tenant-chooser-dropdown" }, { kind: "component", type: AXPAppChooserListComponent, selector: "axp-app-chooser-list", inputs: ["simple"], outputs: ["applicationChosen"] }, { kind: "component", type: AXPUserAvatarComponent, selector: "axp-user-avatar", inputs: ["size", "userId"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i7.AXTranslatorPipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
44
|
-
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthAppChooserComponent, decorators: [{
|
|
46
|
-
type: Component,
|
|
47
|
-
args: [{ selector: 'axp-auth-app-chooser', imports: [
|
|
48
|
-
CommonModule,
|
|
49
|
-
AXFormModule,
|
|
50
|
-
AXTextBoxModule,
|
|
51
|
-
AXButtonModule,
|
|
52
|
-
AXLabelModule,
|
|
53
|
-
AXCheckBoxModule,
|
|
54
|
-
AXAvatarModule,
|
|
55
|
-
AXImageModule,
|
|
56
|
-
AXDecoratorModule,
|
|
57
|
-
AXPLogoComponent,
|
|
58
|
-
AXLoadingModule,
|
|
59
|
-
AXTranslationModule,
|
|
60
|
-
AXPTenantChooserDropdownComponent,
|
|
61
|
-
AXPAppChooserListComponent,
|
|
62
|
-
AXPUserAvatarComponent,
|
|
63
|
-
], encapsulation: ViewEncapsulation.None, template: "<main\n *translate=\"let t\"\n class=\"w-full space-y-10 h-[100vh] flex flex-col items-center justify-center bg-lightest md:bg-default\"\n>\n <section>\n <axp-logo\n logoKey=\"platform\"\n appearance=\"onLight\"\n format=\"full\"\n [size]=\"160\"\n [attr.alt]=\"platformConfig.title\"\n class=\"w-36 mx-auto text-2xl font-bold\"\n ></axp-logo>\n </section>\n <section class=\"flex justify-center\">\n <div\n class=\"flex gap-2 justify-center text-center flex-col items-center border rounded-lg shadow-lg p-6 lg:w-[45vw] xl:w-[25vw] w-[90vw]\"\n >\n <ax-avatar class=\"rounded-full\" [size]=\"72\">\n @if (user?.avatar) {\n <axp-user-avatar [size]=\"72\" [userId]=\"user?.id!\"></axp-user-avatar>\n }\n </ax-avatar>\n <h2 class=\"md:text-lg font-medium\">\n {{ '@auth:welcome.message' | translate | async }}, {{ user?.title }}\n </h2>\n <axp-tenant-chooser-dropdown></axp-tenant-chooser-dropdown>\n <p class=\"text-neutral-500 text-sm md:text-base font-medium\">\n {{ '@auth:application-chooser.description' | translate | async }}\n </p>\n <div class=\"mt-3 w-full overflow-auto max-h-[300px]\">\n <axp-app-chooser-list></axp-app-chooser-list>\n </div>\n </div>\n </section>\n <section>\n <p class=\"text-neutral-400 text-sm\">\n {{ '@auth:application-chooser.footer' | translate | async }}\n @if (tenants$ | async; as tenants) {\n @if (tenants.length > 1) {\n <a\n (click)=\"tenantChooser()\"\n class=\"text-primary-500 cursor-pointer font-medium hover:underline\"\n >\n {{ '@auth:application-chooser.backCompany' | translate | async }}\n </a>\n } @else {\n <a\n (click)=\"handleSignout()\"\n class=\"text-primary-500 font-medium cursor-pointer hover:underline\"\n >\n {{ '@auth:backLogin' | translate | async }}\n </a>\n }\n }\n </p>\n </section>\n</main>\n", styles: [".gradient{background:-webkit-linear-gradient(var(--ax-current-v1),var(--ax-current-v2));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
64
|
-
}] });
|
|
65
|
-
|
|
66
|
-
export { AXPAuthAppChooserComponent };
|
|
67
|
-
//# sourceMappingURL=acorex-platform-module-auth-client-app-chooser.component-IPLp1kVv.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-auth-client-app-chooser.component-IPLp1kVv.mjs","sources":["../../../../libs/modules/auth/client/src/lib/pages/account/app-chooser/app-chooser.component.ts","../../../../libs/modules/auth/client/src/lib/pages/account/app-chooser/app-chooser.component.html"],"sourcesContent":["import { Component, OnInit, ViewEncapsulation, inject } from '@angular/core';\n\nimport { AXAvatarModule } from '@acorex/components/avatar';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXCheckBoxModule } from '@acorex/components/check-box';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXFormModule } from '@acorex/components/form';\nimport { AXImageModule } from '@acorex/components/image';\nimport { AXLabelModule } from '@acorex/components/label';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTextBoxModule } from '@acorex/components/text-box';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXP_PLATFORM_CONFIG_TOKEN } from '@acorex-platform/framework-client/common';\nimport { AXPLogoComponent } from '@acorex-platform/framework-client/core';\nimport { AXPUserAvatarComponent } from '@acorex-platform/framework-client/layout/components';\nimport { CommonModule } from '@angular/common';\nimport { Router } from '@angular/router';\nimport { AXPTenantChooserDropdownComponent } from '../tenant-chooser/tenant-chooser-dropdown.component';\nimport { AXPAppChooserListComponent } from './app-chooser-list.component';\n\n@Component({\n selector: 'axp-auth-app-chooser',\n templateUrl: './app-chooser.component.html',\n styleUrls: ['./app-chooser.component.css'],\n imports: [\n CommonModule,\n AXFormModule,\n AXTextBoxModule,\n AXButtonModule,\n AXLabelModule,\n AXCheckBoxModule,\n AXAvatarModule,\n AXImageModule,\n AXDecoratorModule,\n AXPLogoComponent,\n AXLoadingModule,\n AXTranslationModule,\n AXPTenantChooserDropdownComponent,\n AXPAppChooserListComponent,\n AXPUserAvatarComponent,\n ],\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXPAuthAppChooserComponent implements OnInit {\n ngOnInit(): void {\n }\n private router = inject(Router);\n protected platformConfig = inject(AXP_PLATFORM_CONFIG_TOKEN);\n private sessionService = inject(AXPSessionService);\n\n protected user = this.sessionService.user;\n protected tenants$ = this.sessionService.tenants$;\n protected tenant = this.sessionService.tenant;\n\n tenantChooser() {\n this.router.navigate(['/auth/account/tenant-chooser']);\n }\n\n async handleSignout() {\n await this.sessionService.signout();\n this.router.navigate(['/auth/login']);\n }\n}\n","<main\n *translate=\"let t\"\n class=\"w-full space-y-10 h-[100vh] flex flex-col items-center justify-center bg-lightest md:bg-default\"\n>\n <section>\n <axp-logo\n logoKey=\"platform\"\n appearance=\"onLight\"\n format=\"full\"\n [size]=\"160\"\n [attr.alt]=\"platformConfig.title\"\n class=\"w-36 mx-auto text-2xl font-bold\"\n ></axp-logo>\n </section>\n <section class=\"flex justify-center\">\n <div\n class=\"flex gap-2 justify-center text-center flex-col items-center border rounded-lg shadow-lg p-6 lg:w-[45vw] xl:w-[25vw] w-[90vw]\"\n >\n <ax-avatar class=\"rounded-full\" [size]=\"72\">\n @if (user?.avatar) {\n <axp-user-avatar [size]=\"72\" [userId]=\"user?.id!\"></axp-user-avatar>\n }\n </ax-avatar>\n <h2 class=\"md:text-lg font-medium\">\n {{ '@auth:welcome.message' | translate | async }}, {{ user?.title }}\n </h2>\n <axp-tenant-chooser-dropdown></axp-tenant-chooser-dropdown>\n <p class=\"text-neutral-500 text-sm md:text-base font-medium\">\n {{ '@auth:application-chooser.description' | translate | async }}\n </p>\n <div class=\"mt-3 w-full overflow-auto max-h-[300px]\">\n <axp-app-chooser-list></axp-app-chooser-list>\n </div>\n </div>\n </section>\n <section>\n <p class=\"text-neutral-400 text-sm\">\n {{ '@auth:application-chooser.footer' | translate | async }}\n @if (tenants$ | async; as tenants) {\n @if (tenants.length > 1) {\n <a\n (click)=\"tenantChooser()\"\n class=\"text-primary-500 cursor-pointer font-medium hover:underline\"\n >\n {{ '@auth:application-chooser.backCompany' | translate | async }}\n </a>\n } @else {\n <a\n (click)=\"handleSignout()\"\n class=\"text-primary-500 font-medium cursor-pointer hover:underline\"\n >\n {{ '@auth:backLogin' | translate | async }}\n </a>\n }\n }\n </p>\n </section>\n</main>\n"],"names":["i2","i3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;MA4Ca,0BAA0B,CAAA;AAvBvC,IAAA,WAAA,GAAA;AA0BU,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACrB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACpD,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAExC,QAAA,IAAA,CAAA,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI;AAC/B,QAAA,IAA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E,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,sBAAsB,EAAA,OAAA,EAGvB;wBACP,YAAY;wBACZ,YAAY;wBACZ,eAAe;wBACf,cAAc;wBACd,aAAa;wBACb,gBAAgB;wBAChB,cAAc;wBACd,aAAa;wBACb,iBAAiB;wBACjB,gBAAgB;wBAChB,eAAe;wBACf,mBAAmB;wBACnB,iCAAiC;wBACjC,0BAA0B;wBAC1B,sBAAsB;qBACvB,EAAA,aAAA,EACc,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,qhEAAA,EAAA,MAAA,EAAA,CAAA,qPAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-auth-client-blank.layout-BRGgntib.mjs","sources":["../../../../libs/modules/auth/client/src/lib/shared/layouts/blank/blank.layout.ts","../../../../libs/modules/auth/client/src/lib/shared/layouts/blank/blank.layout.html"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { RouterModule } from '@angular/router';\n\n@Component({\n templateUrl: 'blank.layout.html',\n imports: [RouterModule]\n})\nexport class AXPAuthBlankLayoutComponent implements OnInit {\n constructor() { }\n\n ngOnInit() { }\n}\n","<router-outlet></router-outlet>"],"names":[],"mappings":";;;;;MAOa,2BAA2B,CAAA;AACtC,IAAA,WAAA,GAAA,EAAgB;AAEhB,IAAA,QAAQ,KAAK;8GAHF,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECPxC,iCAA+B,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDKjB,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,kBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,QAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAEb,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAJvC,SAAS;AAEG,YAAA,IAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,iCAAA,EAAA;;;;;"}
|
package/fesm2022/acorex-platform-module-auth-client-change-password.command-O8Mgxoqj.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-auth-client-change-password.command-O8Mgxoqj.mjs","sources":["../../../../libs/modules/auth/client/src/lib/commands/change-password.command.ts"],"sourcesContent":["import { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport {RootConfig as SecurityManagementRootConfig} from '@acorex-platform/module-security-management-client/contracts'\nimport {AXMSecurityManagementUsersEntityModel} from '@acorex-platform/module-security-management-client/contracts';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPExecuteCommandResult, hashPassword, verifyPassword } from '@acorex-platform/framework-shared/core';\nimport { AXPLayoutBuilderService } from '@acorex-platform/framework-client/layout/builder';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { inject, Injectable } from '@angular/core';\nimport { get, isNil } from 'lodash';\nimport {\n getPasswordComplexityHintKey,\n getPasswordComplexityValidationMessageKey,\n validatePasswordAgainstComplexity,\n} from '../shared/utils/password-complexity.utils';\nimport { AXPAuthPasswordComplexityService } from '../shared/services/password-complexity.service';\nimport { AXPAuthPasswordChangeTrackingService } from '../shared/services/password-change-tracking.service';\n\n//#region ---- Change password command ----\n\n/** Opens a dialog to change the signed-in user's password. */\n@Injectable({ providedIn: 'root' })\nexport class AXPChangePasswordCommand implements AXPCommand {\n //#region ---- Services & Dependencies ----\n\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly entityService = inject(AXPEntityService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly passwordComplexityService = inject(AXPAuthPasswordComplexityService);\n private readonly passwordChangeTrackingService = inject(AXPAuthPasswordChangeTrackingService);\n private readonly toastService = inject(AXToastService);\n private readonly translateService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command ----\n\n async execute(): Promise<AXPExecuteCommandResult<void>> {\n const passwordComplexity = await this.passwordComplexityService.getLevel();\n const complexityHintKey = getPasswordComplexityHintKey(passwordComplexity);\n const complexityValidationMessageKey = getPasswordComplexityValidationMessageKey(passwordComplexity);\n const complexityValidationMessage = await this.translateService.translateAsync(complexityValidationMessageKey);\n\n const dialogTitle = await this.translateService.translateAsync(\n '@auth:profile-page.commands.change-password.dialog.title',\n );\n\n const result = await this.layoutBuilder\n .create()\n .dialog<AXPExecuteCommandResult<void>>((dialog) => {\n dialog\n .setTitle(dialogTitle)\n .setSize('md')\n .setCloseButton(true)\n .setContext({\n currentPassword: '',\n newPassword: '',\n confirmPassword: '',\n })\n .content((layout) => {\n layout.flex((flex) => {\n flex\n .setDirection('column')\n .setGap('1rem')\n .formField('@auth:profile-page.commands.change-password.fields.current-password.title', (field) => {\n field.setOptions({\n hint: '@auth:profile-page.commands.change-password.fields.current-password.hint',\n hintDisplayMode: 'note',\n });\n field.path('currentPassword');\n field.passwordBox({\n revealToggle: true,\n placeholder: '@auth:profile-page.commands.change-password.fields.current-password.placeholder',\n validations: [{ rule: 'required' }],\n });\n })\n .formField('@auth:profile-page.commands.change-password.fields.new-password.title', (field) => {\n field.setOptions({ hint: complexityHintKey, hintDisplayMode: 'note' });\n field.path('newPassword');\n field.passwordBox({\n revealToggle: true,\n placeholder: '@auth:profile-page.commands.change-password.fields.new-password.placeholder',\n validations: [\n { rule: 'required' },\n {\n rule: 'password-complexity',\n options: {\n message: complexityValidationMessage,\n },\n },\n ],\n });\n })\n .formField('@auth:profile-page.commands.change-password.fields.confirm-password.title', (field) => {\n field.setOptions({\n hint: '@auth:profile-page.commands.change-password.fields.confirm-password.hint',\n hintDisplayMode: 'note',\n });\n field.path('confirmPassword');\n field.passwordBox({\n revealToggle: true,\n placeholder: '@auth:profile-page.commands.change-password.fields.confirm-password.placeholder',\n validations: [{ rule: 'required' }],\n });\n });\n });\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@auth:profile-page.commands.change-password.actions.submit');\n })\n .onAction(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return { success: false };\n }\n\n const form = dialogRef.context() as {\n currentPassword?: string;\n newPassword?: string;\n confirmPassword?: string;\n };\n\n const currentPassword = form.currentPassword ?? '';\n const newPassword = form.newPassword ?? '';\n const confirmPassword = form.confirmPassword ?? '';\n\n if (newPassword !== confirmPassword) {\n await this.showError('@auth:profile-page.commands.change-password.messages.mismatch');\n throw new Error('Password confirmation mismatch');\n }\n\n if (newPassword === currentPassword) {\n await this.showError('@auth:profile-page.commands.change-password.messages.same-as-current');\n throw new Error('New password matches current password');\n }\n\n const submitComplexity = await this.passwordComplexityService.getLevel();\n const submitValidationMessageKey = getPasswordComplexityValidationMessageKey(submitComplexity);\n\n if (!validatePasswordAgainstComplexity(newPassword, submitComplexity)) {\n await this.showError(submitValidationMessageKey);\n throw new Error('Password does not meet complexity requirements');\n }\n\n const userId = this.sessionService.user?.id;\n if (isNil(userId)) {\n await this.showError('@auth:profile-page.commands.change-password.messages.not-signed-in');\n throw new Error('No signed-in user');\n }\n\n dialogRef.setLoading(true);\n try {\n const userData = this.entityService\n .withEntity(\n SecurityManagementRootConfig.module.name,\n SecurityManagementRootConfig.entities.users.name,\n )\n .data<string, AXMSecurityManagementUsersEntityModel>();\n\n const user = await userData.byKey(userId);\n\n if (!(await verifyPassword(currentPassword, get(user, 'password')))) {\n await this.showError('@auth:profile-page.commands.change-password.messages.incorrect-current');\n throw new Error('Incorrect current password');\n }\n\n await userData.update(userId, {\n password: await hashPassword(newPassword),\n passwordChangedAt: new Date().toISOString(),\n });\n\n this.passwordChangeTrackingService.recordChange(userId);\n\n const successTitle = await this.translateService.translateAsync(\n '@auth:profile-page.commands.change-password.messages.success',\n );\n this.toastService.show({ color: 'success', title: successTitle });\n dialogRef.close();\n return { success: true };\n } finally {\n dialogRef.setLoading(false);\n }\n });\n })\n .show();\n\n return result ?? { success: false };\n }\n\n //#endregion\n\n //#region ---- Utility Methods ----\n\n private async showError(messageKey: string): Promise<void> {\n const content = await this.translateService.translateAsync(messageKey);\n const title = await this.translateService.translateAsync('@general:messages.generic.error.title');\n this.toastService.show({ color: 'danger', title, content, closeButton: true });\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":["SecurityManagementRootConfig"],"mappings":";;;;;;;;;;;;AAoBA;AAEA;MAEa,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,yBAAyB,GAAG,MAAM,CAAC,gCAAgC,CAAC;AACpE,QAAA,IAAA,CAAA,6BAA6B,GAAG,MAAM,CAAC,oCAAoC,CAAC;AAC5E,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAyKjE,IAAA;;;AAnKC,IAAA,MAAM,OAAO,GAAA;QACX,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,QAAQ,EAAE;AAC1E,QAAA,MAAM,i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AMQ,MAAM,SAAS,CAAC,UAAkB,EAAA;QACxC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,UAAU,CAAC;QACtE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,uCAAuC,CAAC;AACjG,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAChF;8GA/KW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cADX,MAAM,EAAA,CAAA,CAAA;;2FACnB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { AXToastService } from '@acorex/components/toast';
|
|
2
|
-
import { AXTranslationService } from '@acorex/core/translation';
|
|
3
|
-
import { AXPSessionService } from '@acorex-platform/framework-client/auth';
|
|
4
|
-
import { AXPImageEditorService } from '@acorex-platform/framework-client/layout/components';
|
|
5
|
-
import { AXPLayoutBuilderService } from '@acorex-platform/framework-client/layout/builder';
|
|
6
|
-
import { AXFileService } from '@acorex/core/file';
|
|
7
|
-
import * as i0 from '@angular/core';
|
|
8
|
-
import { inject, Injectable } from '@angular/core';
|
|
9
|
-
import { isNil } from 'lodash';
|
|
10
|
-
import { g as AXPUserAvatarSyncService } from './acorex-platform-module-auth-client-acorex-platform-module-auth-client-mW7tx8C0.mjs';
|
|
11
|
-
|
|
12
|
-
/** Self-service profile photo upload, replace, and removal backed by file storage. */
|
|
13
|
-
class AXPChangePhotoCommand {
|
|
14
|
-
constructor() {
|
|
15
|
-
//#region ---- Services & Dependencies ----
|
|
16
|
-
this.layoutBuilder = inject(AXPLayoutBuilderService);
|
|
17
|
-
this.fileService = inject(AXFileService);
|
|
18
|
-
this.imageEditor = inject(AXPImageEditorService);
|
|
19
|
-
this.avatarSync = inject(AXPUserAvatarSyncService);
|
|
20
|
-
this.sessionService = inject(AXPSessionService);
|
|
21
|
-
this.toastService = inject(AXToastService);
|
|
22
|
-
this.translateService = inject(AXTranslationService);
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region ---- Command ----
|
|
26
|
-
async execute(input = {}) {
|
|
27
|
-
const userId = this.sessionService.user?.id;
|
|
28
|
-
if (isNil(userId)) {
|
|
29
|
-
return {
|
|
30
|
-
success: false,
|
|
31
|
-
message: {
|
|
32
|
-
text: await this.translateService.translateAsync('@auth:profile-page.commands.change-photo.messages.not-signed-in'),
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
const mode = input.mode ?? 'manage';
|
|
37
|
-
if (mode === 'upload') {
|
|
38
|
-
return this.executeUploadFlow(userId);
|
|
39
|
-
}
|
|
40
|
-
return this.executeManageFlow(userId);
|
|
41
|
-
}
|
|
42
|
-
async executeUploadFlow(userId) {
|
|
43
|
-
const editedFile = await this.pickAndEditPhoto();
|
|
44
|
-
if (!editedFile) {
|
|
45
|
-
return { success: false };
|
|
46
|
-
}
|
|
47
|
-
await this.uploadAvatarAndNotify(userId, editedFile);
|
|
48
|
-
return { success: true };
|
|
49
|
-
}
|
|
50
|
-
async executeManageFlow(userId) {
|
|
51
|
-
const hasAvatar = !!(await this.avatarSync.getCurrentAvatarRef(userId));
|
|
52
|
-
const previewUrl = await this.resolveDialogPreviewUrl(userId);
|
|
53
|
-
try {
|
|
54
|
-
const result = await this.layoutBuilder
|
|
55
|
-
.create()
|
|
56
|
-
.dialog((dialog) => {
|
|
57
|
-
dialog
|
|
58
|
-
.setTitle('@auth:profile-page.commands.change-photo.dialog.title')
|
|
59
|
-
.setSize('sm')
|
|
60
|
-
.setCloseButton(true)
|
|
61
|
-
.setContext({ previewUrl })
|
|
62
|
-
.content((layout) => {
|
|
63
|
-
layout.flex((flex) => {
|
|
64
|
-
flex.setDirection('column').setGap('1rem').setAlignItems('center').setJustifyContent('center');
|
|
65
|
-
if (previewUrl) {
|
|
66
|
-
flex.customWidget('image', {
|
|
67
|
-
path: 'previewUrl',
|
|
68
|
-
type: 'profile-photo',
|
|
69
|
-
readonly: true,
|
|
70
|
-
enablePreviewClick: false,
|
|
71
|
-
responsiveSize: {
|
|
72
|
-
small: { width: '300px', height: '300px' },
|
|
73
|
-
large: { width: '500px', height: '500px' },
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
flex.customWidget('state-message', {
|
|
79
|
-
mode: 'empty',
|
|
80
|
-
icon: 'fa-light fa-user',
|
|
81
|
-
title: '@auth:profile-page.commands.change-photo.empty-state.title',
|
|
82
|
-
description: '@auth:profile-page.commands.change-photo.empty-state.description',
|
|
83
|
-
responsiveSize: {
|
|
84
|
-
small: { width: '300px', height: '300px' },
|
|
85
|
-
large: { width: '500px', height: '500px' },
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
})
|
|
91
|
-
.setActions((actions) => {
|
|
92
|
-
if (hasAvatar) {
|
|
93
|
-
actions.custom({
|
|
94
|
-
title: '@auth:profile-page.commands.change-photo.actions.remove',
|
|
95
|
-
color: 'danger',
|
|
96
|
-
position: 'prefix',
|
|
97
|
-
command: { name: 'remove' },
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
actions.custom({
|
|
101
|
-
title: hasAvatar
|
|
102
|
-
? '@auth:profile-page.commands.change-photo.actions.change'
|
|
103
|
-
: '@auth:profile-page.commands.change-photo.actions.upload',
|
|
104
|
-
color: 'primary',
|
|
105
|
-
command: { name: 'change' },
|
|
106
|
-
});
|
|
107
|
-
})
|
|
108
|
-
.onAction(async (dialogRef) => {
|
|
109
|
-
const action = dialogRef.action();
|
|
110
|
-
if (action === 'remove') {
|
|
111
|
-
dialogRef.setLoading(true);
|
|
112
|
-
try {
|
|
113
|
-
await this.avatarSync.removeAvatar(userId);
|
|
114
|
-
const title = await this.translateService.translateAsync('@auth:profile-page.commands.change-photo.messages.removed');
|
|
115
|
-
this.toastService.show({ color: 'success', title });
|
|
116
|
-
dialogRef.close();
|
|
117
|
-
return { success: true };
|
|
118
|
-
}
|
|
119
|
-
finally {
|
|
120
|
-
dialogRef.setLoading(false);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (action === 'change') {
|
|
124
|
-
const editedFile = await this.pickAndEditPhoto();
|
|
125
|
-
if (!editedFile) {
|
|
126
|
-
return { success: false, keepDialogOpen: true };
|
|
127
|
-
}
|
|
128
|
-
dialogRef.setLoading(true);
|
|
129
|
-
try {
|
|
130
|
-
await this.uploadAvatarAndNotify(userId, editedFile);
|
|
131
|
-
dialogRef.close();
|
|
132
|
-
return { success: true };
|
|
133
|
-
}
|
|
134
|
-
finally {
|
|
135
|
-
dialogRef.setLoading(false);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return { success: false, keepDialogOpen: true };
|
|
139
|
-
});
|
|
140
|
-
})
|
|
141
|
-
.show();
|
|
142
|
-
return result ?? { success: false };
|
|
143
|
-
}
|
|
144
|
-
finally {
|
|
145
|
-
if (previewUrl?.startsWith('blob:')) {
|
|
146
|
-
URL.revokeObjectURL(previewUrl);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
async resolveDialogPreviewUrl(userId) {
|
|
151
|
-
const blob = await this.avatarSync.getCurrentAvatarBlob(userId);
|
|
152
|
-
if (!blob) {
|
|
153
|
-
return null;
|
|
154
|
-
}
|
|
155
|
-
return URL.createObjectURL(blob);
|
|
156
|
-
}
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region ---- Utility Methods ----
|
|
159
|
-
async uploadAvatarAndNotify(userId, file) {
|
|
160
|
-
await this.avatarSync.uploadAndSetAvatar(userId, file);
|
|
161
|
-
const title = await this.translateService.translateAsync('@auth:profile-page.commands.change-photo.messages.success');
|
|
162
|
-
this.toastService.show({ color: 'success', title });
|
|
163
|
-
}
|
|
164
|
-
async pickAndEditPhoto() {
|
|
165
|
-
const files = await this.fileService.choose({ accept: 'image/png, image/jpeg, image/webp' });
|
|
166
|
-
const picked = files[0];
|
|
167
|
-
if (!picked) {
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
const editedBlob = await this.imageEditor.open({
|
|
171
|
-
image: picked,
|
|
172
|
-
title: '@auth:profile-page.commands.change-photo.dialog.editor-title',
|
|
173
|
-
look: 'blank',
|
|
174
|
-
aspectRatio: '1',
|
|
175
|
-
});
|
|
176
|
-
if (!editedBlob) {
|
|
177
|
-
return null;
|
|
178
|
-
}
|
|
179
|
-
return new File([editedBlob], picked.name || 'profile-photo.png', {
|
|
180
|
-
type: editedBlob.type || 'image/png',
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPChangePhotoCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
184
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPChangePhotoCommand, providedIn: 'root' }); }
|
|
185
|
-
}
|
|
186
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPChangePhotoCommand, decorators: [{
|
|
187
|
-
type: Injectable,
|
|
188
|
-
args: [{ providedIn: 'root' }]
|
|
189
|
-
}] });
|
|
190
|
-
|
|
191
|
-
export { AXPChangePhotoCommand };
|
|
192
|
-
//# sourceMappingURL=acorex-platform-module-auth-client-change-photo.command-BcNq9mTU.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-auth-client-change-photo.command-BcNq9mTU.mjs","sources":["../../../../libs/modules/auth/client/src/lib/commands/change-photo.command.ts"],"sourcesContent":["import { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPExecuteCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPImageEditorService } from '@acorex-platform/framework-client/layout/components';\nimport { AXPLayoutBuilderService } from '@acorex-platform/framework-client/layout/builder';\nimport { AXFileService } from '@acorex/core/file';\n\nimport { inject, Injectable } from '@angular/core';\nimport { isNil } from 'lodash';\n\nimport { AXPUserAvatarSyncService } from '../shared/services/user-avatar-sync.service';\n\n//#region ---- Change photo command ----\n\nexport type AXPChangePhotoCommandMode = 'upload' | 'manage';\n\nexport type AXPChangePhotoCommandInput = {\n mode?: AXPChangePhotoCommandMode;\n};\n\n/** Self-service profile photo upload, replace, and removal backed by file storage. */\n@Injectable({ providedIn: 'root' })\nexport class AXPChangePhotoCommand implements AXPCommand<AXPChangePhotoCommandInput, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly fileService = inject(AXFileService);\n private readonly imageEditor = inject(AXPImageEditorService);\n private readonly avatarSync = inject(AXPUserAvatarSyncService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly toastService = inject(AXToastService);\n private readonly translateService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command ----\n\n async execute(input: AXPChangePhotoCommandInput = {}): Promise<AXPExecuteCommandResult<void>> {\n const userId = this.sessionService.user?.id;\n if (isNil(userId)) {\n return {\n success: false,\n message: {\n text: await this.translateService.translateAsync(\n '@auth:profile-page.commands.change-photo.messages.not-signed-in',\n ),\n },\n };\n }\n\n const mode = input.mode ?? 'manage';\n if (mode === 'upload') {\n return this.executeUploadFlow(userId);\n }\n\n return this.executeManageFlow(userId);\n }\n\n private async executeUploadFlow(userId: string): Promise<AXPExecuteCommandResult<void>> {\n const editedFile = await this.pickAndEditPhoto();\n if (!editedFile) {\n return { success: false };\n }\n\n await this.uploadAvatarAndNotify(userId, editedFile);\n return { success: true };\n }\n\n private async executeManageFlow(userId: string): Promise<AXPExecuteCommandResult<void>> {\n const hasAvatar = !!(await this.avatarSync.getCurrentAvatarRef(userId));\n const previewUrl = await this.resolveDialogPreviewUrl(userId);\n\n try {\n const result = await this.layoutBuilder\n .create()\n .dialog<AXPExecuteCommandResult<void>>((dialog) => {\n dialog\n .setTitle('@auth:profile-page.commands.change-photo.dialog.title')\n .setSize('sm')\n .setCloseButton(true)\n .setContext({ previewUrl })\n .content((layout) => {\n layout.flex((flex) => {\n flex.setDirection('column').setGap('1rem').setAlignItems('center').setJustifyContent('center');\n if (previewUrl) {\n flex.customWidget('image', {\n path: 'previewUrl',\n type: 'profile-photo',\n readonly: true,\n enablePreviewClick: false,\n responsiveSize: {\n small: { width: '300px', height: '300px' },\n large: { width: '500px', height: '500px' },\n },\n });\n } else {\n flex.customWidget('state-message', {\n mode: 'empty',\n icon: 'fa-light fa-user',\n title: '@auth:profile-page.commands.change-photo.empty-state.title',\n description: '@auth:profile-page.commands.change-photo.empty-state.description',\n responsiveSize: {\n small: { width: '300px', height: '300px' },\n large: { width: '500px', height: '500px' },\n },\n });\n }\n });\n })\n .setActions((actions) => {\n if (hasAvatar) {\n actions.custom({\n title: '@auth:profile-page.commands.change-photo.actions.remove',\n color: 'danger',\n position: 'prefix',\n command: { name: 'remove' },\n });\n }\n actions.custom({\n title: hasAvatar\n ? '@auth:profile-page.commands.change-photo.actions.change'\n : '@auth:profile-page.commands.change-photo.actions.upload',\n color: 'primary',\n command: { name: 'change' },\n });\n })\n .onAction(async (dialogRef) => {\n const action = dialogRef.action();\n\n if (action === 'remove') {\n dialogRef.setLoading(true);\n try {\n await this.avatarSync.removeAvatar(userId);\n const title = await this.translateService.translateAsync(\n '@auth:profile-page.commands.change-photo.messages.removed',\n );\n this.toastService.show({ color: 'success', title });\n dialogRef.close();\n return { success: true };\n } finally {\n dialogRef.setLoading(false);\n }\n }\n\n if (action === 'change') {\n const editedFile = await this.pickAndEditPhoto();\n if (!editedFile) {\n return { success: false, keepDialogOpen: true };\n }\n\n dialogRef.setLoading(true);\n try {\n await this.uploadAvatarAndNotify(userId, editedFile);\n dialogRef.close();\n return { success: true };\n } finally {\n dialogRef.setLoading(false);\n }\n }\n\n return { success: false, keepDialogOpen: true };\n });\n })\n .show();\n\n return result ?? { success: false };\n } finally {\n if (previewUrl?.startsWith('blob:')) {\n URL.revokeObjectURL(previewUrl);\n }\n }\n }\n\n private async resolveDialogPreviewUrl(userId: string): Promise<string | null> {\n const blob = await this.avatarSync.getCurrentAvatarBlob(userId);\n if (!blob) {\n return null;\n }\n return URL.createObjectURL(blob);\n }\n\n //#endregion\n\n //#region ---- Utility Methods ----\n\n private async uploadAvatarAndNotify(userId: string, file: File): Promise<void> {\n await this.avatarSync.uploadAndSetAvatar(userId, file);\n const title = await this.translateService.translateAsync(\n '@auth:profile-page.commands.change-photo.messages.success',\n );\n this.toastService.show({ color: 'success', title });\n }\n\n private async pickAndEditPhoto(): Promise<File | null> {\n const files = await this.fileService.choose({ accept: 'image/png, image/jpeg, image/webp' });\n const picked = files[0];\n if (!picked) {\n return null;\n }\n\n const editedBlob = await this.imageEditor.open({\n image: picked,\n title: '@auth:profile-page.commands.change-photo.dialog.editor-title',\n look: 'blank',\n aspectRatio: '1',\n });\n\n if (!editedBlob) {\n return null;\n }\n\n return new File([editedBlob], picked.name || 'profile-photo.png', {\n type: editedBlob.type || 'image/png',\n });\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;AAsBA;MAEa,qBAAqB,CAAA;AADl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A,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cADR,MAAM,EAAA,CAAA,CAAA;;2FACnB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
package/fesm2022/acorex-platform-module-auth-client-edit-account-info.command-B-mVlXxg.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-auth-client-edit-account-info.command-B-mVlXxg.mjs","sources":["../../../../libs/modules/auth/client/src/lib/commands/edit-account-info.command.ts"],"sourcesContent":["import { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport {RootConfig as SecurityManagementRootConfig} from '@acorex-platform/module-security-management-client/contracts'\nimport {AXMSecurityManagementUsersEntityModel} from '@acorex-platform/module-security-management-client/contracts';\nimport { AXPSessionService, AXPUserProfileIdentityService } from '@acorex-platform/framework-client/auth';\nimport { AXPExecuteCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPLayoutBuilderService } from '@acorex-platform/framework-client/layout/builder';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { inject, Injectable } from '@angular/core';\nimport { defaultTo, isEmpty, isNil, trim } from 'lodash';\n\n//#region ---- Edit account info command ----\n\n/** Opens a self-service dialog for users without an employee record (display name editable; username read-only). */\n@Injectable({ providedIn: 'root' })\nexport class AXPEditAccountInfoCommand implements AXPCommand {\n //#region ---- Services & Dependencies ----\n\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly entityService = inject(AXPEntityService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly identityService = inject(AXPUserProfileIdentityService);\n private readonly toastService = inject(AXToastService);\n private readonly translateService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command ----\n\n async execute(): Promise<AXPExecuteCommandResult<void>> {\n const userId = this.sessionService.user?.id;\n if (isNil(userId)) {\n return {\n success: false,\n message: {\n text: await this.translateService.translateAsync(\n '@auth:profile-page.commands.edit-account-info.messages.not-signed-in',\n ),\n },\n };\n }\n\n const userData = this.entityService\n .withEntity(\n SecurityManagementRootConfig.module.name,\n SecurityManagementRootConfig.entities.users.name,\n )\n .data<string, AXMSecurityManagementUsersEntityModel>();\n\n const user = await userData.byKey(userId);\n if (isNil(user)) {\n return {\n success: false,\n message: {\n text: await this.translateService.translateAsync(\n '@auth:profile-page.commands.edit-account-info.messages.user-not-found',\n ),\n },\n };\n }\n\n const dialogTitle = await this.translateService.translateAsync(\n '@auth:profile-page.commands.edit-account-info.dialog.title',\n );\n\n const result = await this.layoutBuilder\n .create()\n .dialog<AXPExecuteCommandResult<void>>((dialog) => {\n dialog\n .setTitle(dialogTitle)\n .setSize('md')\n .setCloseButton(true)\n .setContext({\n username: defaultTo(user.username, ''),\n displayName: defaultTo(user.displayName, ''),\n })\n .content((layout) => {\n layout.flex((flex) => {\n flex\n .setDirection('column')\n .setGap('1rem')\n .formField('@general:terms.contact.username', (field) => {\n field.path('username');\n field.disabled(true);\n field.textBox({\n placeholder: '@general:terms.contact.username',\n });\n })\n .formField('@general:terms.common.display-name', (field) => {\n field.path('displayName');\n field.textBox({\n placeholder: '@general:terms.common.display-name',\n validations: [{ rule: 'required' }],\n });\n });\n });\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@general:actions.save.title');\n })\n .onAction(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return { success: false };\n }\n\n const form = dialogRef.context() as { username?: string; displayName?: string };\n const displayName = trim(defaultTo(form.displayName, ''));\n\n if (isEmpty(displayName)) {\n await this.showError('@auth:profile-page.commands.edit-account-info.messages.required-fields');\n throw new Error('Display name is required');\n }\n\n dialogRef.setLoading(true);\n try {\n await userData.update(userId, { displayName });\n\n await this.identityService.applySessionPatch({\n title: displayName,\n });\n\n const successTitle = await this.translateService.translateAsync(\n '@auth:profile-page.commands.edit-account-info.messages.success',\n );\n this.toastService.show({ color: 'success', title: successTitle });\n dialogRef.close();\n return { success: true };\n } finally {\n dialogRef.setLoading(false);\n }\n });\n })\n .show();\n\n return result ?? { success: false };\n }\n\n //#endregion\n\n //#region ---- Utility Methods ----\n\n private async showError(messageKey: string): Promise<void> {\n const content = await this.translateService.translateAsync(messageKey);\n const title = await this.translateService.translateAsync('@general:messages.generic.error.title');\n this.toastService.show({ color: 'danger', title, content, closeButton: true });\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":["SecurityManagementRootConfig"],"mappings":";;;;;;;;;;AAaA;AAEA;MAEa,yBAAyB,CAAA;AADtC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,6BAA6B,CAAC;AACvD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AA8HjE,IAAA;;;AAxHC,IAAA,MAAM,OAAO,GAAA;QACX,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE;AAC3C,QAAA,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE;YACjB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP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AA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cADZ,MAAM,EAAA,CAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-auth-client-edit-signature.command-CcTJJwAX.mjs","sources":["../../../../libs/modules/auth/client/src/lib/commands/edit-signature.command.ts"],"sourcesContent":["import { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPExecuteCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { inject, Injectable } from '@angular/core';\n\n//#region ---- Edit signature command (stub) ----\n\n/**\n * Opens the signature editor for the current user. Full flow will be added in a follow-up iteration.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXPEditSignatureCommand implements AXPCommand {\n //#region ---- Services & Dependencies ----\n\n private readonly toastService = inject(AXToastService);\n private readonly translateService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command ----\n\n async execute(): Promise<AXPExecuteCommandResult<void>> {\n const text = await this.translateService.translateAsync('@auth:profile-page.commands.edit-signature.coming-soon');\n this.toastService.show({ color: 'primary', title: text });\n return { success: true };\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;AAOA;AAEA;;AAEG;MAEU,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAajE,IAAA;;;AAPC,IAAA,MAAM,OAAO,GAAA;QACX,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,wDAAwD,CAAC;AACjH,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzD,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;IAC1B;8GAdW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cADV,MAAM,EAAA,CAAA,CAAA;;2FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-auth-client-lock-screen.command-PMoJJxe7.mjs","sources":["../../../../libs/modules/auth/client/src/lib/commands/lock-screen.command.ts"],"sourcesContent":["import { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport { AXPExecuteCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { inject, Injectable } from '@angular/core';\nimport { AXPIdleLockService } from '../shared/services/idle-lock.service';\n\n//#region ---- Lock screen command ----\n\n/** Locks the session overlay when Lock When Idle is enabled. */\n@Injectable({ providedIn: 'root' })\nexport class AXPLockScreenCommand implements AXPCommand {\n //#region ---- Services & Dependencies ----\n\n private readonly idleLockService = inject(AXPIdleLockService);\n\n //#endregion\n\n //#region ---- Command ----\n\n async execute(): Promise<AXPExecuteCommandResult<void>> {\n await this.idleLockService.refreshLockState();\n\n if (this.idleLockService.canLock()) {\n this.idleLockService.lockScreen();\n }\n\n return { success: true };\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAMA;AAEA;MAEa,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAiB9D,IAAA;;;AAXC,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,MAAM,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE;AAE7C,QAAA,IAAI,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,EAAE;AAClC,YAAA,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE;QACnC;AAEA,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;IAC1B;8GAjBW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-auth-client-login.module-C4S0RjM7.mjs","sources":["../../../../libs/modules/auth/client/src/lib/pages/login/login.module.ts"],"sourcesContent":["import { NgModule, inject } from '@angular/core';\nimport { ROUTES, RouterModule, Routes } from '@angular/router';\nimport { AXMAuthenticationTypes, AXM_AUTH_CONFIG_TOKEN, AXM_LOGIN_GUARD_TOKEN } from '../../auth.config';\n\nfunction routesFacory() {\n const val = inject(AXM_AUTH_CONFIG_TOKEN);\n const loginGuard = inject(AXM_LOGIN_GUARD_TOKEN);\n let routes: Routes = [];\n routes = [\n {\n path: 'login',\n canActivate: [loginGuard],\n loadComponent: () => {\n if (\n [\n AXMAuthenticationTypes.UsernamePassword,\n AXMAuthenticationTypes.EmailPassword,\n AXMAuthenticationTypes.MobilePassword,\n ].includes(val.type)\n ) {\n return import('./password/password.component').then((c) => c.AXPLoginPasswordComponent);\n } else {\n return import('./password/password.component').then((c) => c.AXPLoginPasswordComponent);\n }\n },\n },\n ];\n return routes;\n}\n\n@NgModule({\n imports: [RouterModule],\n exports: [],\n providers: [\n {\n provide: ROUTES,\n multi: true,\n useFactory: routesFacory,\n },\n ],\n})\nexport class AXPSignInModule {}\n"],"names":[],"mappings":";;;;;AAIA,SAAS,YAAY,GAAA;AACnB,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACzC,IAAA,MAAM,UAAU,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAChD,IAAI,MAAM,GAAW,EAAE;AACvB,IAAA,MAAM,GAAG;AACP,QAAA;AACE,YAAA,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,CAAC,UAAU,CAAC;YACzB,aAAa,EAAE,MAAK;gBAClB,IACE;AACE,oBAAA,sBAAsB,CAAC,gBAAgB;AACvC,oBAAA,sBAAsB,CAAC,aAAa;AACpC,oBAAA,sBAAsB,CAAC,cAAc;AACtC,iBAAA,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EACpB;AACA,oBAAA,OAAO,OAAO,sEAA+B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,yBAAyB,CAAC;gBACzF;qBAAO;AACL,oBAAA,OAAO,OAAO,sEAA+B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,yBAAyB,CAAC;gBACzF;YACF,CAAC;AACF,SAAA;KACF;AACD,IAAA,OAAO,MAAM;AACf;MAaa,eAAe,CAAA;8GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YAVhB,YAAY,CAAA,EAAA,CAAA,CAAA;AAUX,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAAA,SAAA,EARf;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,MAAM;AACf,gBAAA,KAAK,EAAE,IAAI;AACX,gBAAA,UAAU,EAAE,YAAY;AACzB,aAAA;AACF,SAAA,EAAA,OAAA,EAAA,CARS,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAUX,eAAe,EAAA,UAAA,EAAA,CAAA;kBAX3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,MAAM;AACf,4BAAA,KAAK,EAAE,IAAI;AACX,4BAAA,UAAU,EAAE,YAAY;AACzB,yBAAA;AACF,qBAAA;AACF,iBAAA;;;;;"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { AXP_PLATFORM_CONFIG_TOKEN } from '@acorex-platform/framework-client/common';
|
|
2
|
-
import * as i1$1 from '@acorex-platform/framework-client/core';
|
|
3
|
-
import { AXPLogoComponent, AXPComponentSlotModule, AXPContextStore } from '@acorex-platform/framework-client/core';
|
|
4
|
-
import * as i0 from '@angular/core';
|
|
5
|
-
import { inject, ViewEncapsulation, Component } from '@angular/core';
|
|
6
|
-
import * as i1 from '@angular/router';
|
|
7
|
-
import { RouterModule } from '@angular/router';
|
|
8
|
-
import { n as AXM_AUTH_CONFIG_TOKEN } from './acorex-platform-module-auth-client-acorex-platform-module-auth-client-mW7tx8C0.mjs';
|
|
9
|
-
|
|
10
|
-
class AXPAuthMasterLayoutComponent {
|
|
11
|
-
constructor() {
|
|
12
|
-
this.authConfig = inject(AXM_AUTH_CONFIG_TOKEN);
|
|
13
|
-
this.platformConfig = inject(AXP_PLATFORM_CONFIG_TOKEN);
|
|
14
|
-
}
|
|
15
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthMasterLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: AXPAuthMasterLayoutComponent, isStandalone: true, selector: "ng-component", providers: [AXPContextStore], ngImport: i0, template: "<div class=\"w-full h-full flex\">\n <div class=\"flex-1 lightest-surface dark:darker-surface flex flex-col items-center justify-between py-12\">\n <router-outlet></router-outlet>\n <div class=\"flex justify-between\">\n <div class=\"auth-footer-links\">\n <axp-component-slot name=\"auth-footer-links\"></axp-component-slot>\n </div>\n </div>\n </div>\n <div class=\"hidden lg:flex bg-primary-500 flex-1 axp-auth-bk text-white\">\n <div class=\"flex w-full flex-col justify-between px-48 py-20 text-center \">\n <div>\n <axp-logo logoKey=\"platform\" appearance=\"onDark\" format=\"full\" [size]=\"160\" [attr.alt]=\"platformConfig.title\"\n class=\"mx-auto text-2xl\"></axp-logo>\n </div>\n <div>\n <p class=\"font-black text-4xl mb-4\">{{authConfig.signinPage?.slogan}}</p>\n <p>{{authConfig.signinPage?.description}}</p>\n </div>\n </div>\n </div>\n</div>", styles: ["@layer properties;.auth-footer-links{gap:calc(var(--spacing, .25rem) * 5);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}.auth-footer-links a{background-color:transparent;color:var(--ax-comp-bg,var(--color-on-surface))}.auth-footer-links a.ax-state-selected{color:var(--ax-comp-bg-darker,var(--color-on-surface))}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: AXPLogoComponent, selector: "axp-logo", inputs: ["logoKey", "appearance", "size", "format"] }, { kind: "ngmodule", type: AXPComponentSlotModule }, { kind: "directive", type: i1$1.AXPComponentSlotDirective, selector: "axp-component-slot", inputs: ["name", "host", "context"], exportAs: ["slot"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
17
|
-
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPAuthMasterLayoutComponent, decorators: [{
|
|
19
|
-
type: Component,
|
|
20
|
-
args: [{ imports: [RouterModule, AXPLogoComponent, AXPComponentSlotModule], providers: [AXPContextStore], encapsulation: ViewEncapsulation.None, template: "<div class=\"w-full h-full flex\">\n <div class=\"flex-1 lightest-surface dark:darker-surface flex flex-col items-center justify-between py-12\">\n <router-outlet></router-outlet>\n <div class=\"flex justify-between\">\n <div class=\"auth-footer-links\">\n <axp-component-slot name=\"auth-footer-links\"></axp-component-slot>\n </div>\n </div>\n </div>\n <div class=\"hidden lg:flex bg-primary-500 flex-1 axp-auth-bk text-white\">\n <div class=\"flex w-full flex-col justify-between px-48 py-20 text-center \">\n <div>\n <axp-logo logoKey=\"platform\" appearance=\"onDark\" format=\"full\" [size]=\"160\" [attr.alt]=\"platformConfig.title\"\n class=\"mx-auto text-2xl\"></axp-logo>\n </div>\n <div>\n <p class=\"font-black text-4xl mb-4\">{{authConfig.signinPage?.slogan}}</p>\n <p>{{authConfig.signinPage?.description}}</p>\n </div>\n </div>\n </div>\n</div>", styles: ["@layer properties;.auth-footer-links{gap:calc(var(--spacing, .25rem) * 5);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}.auth-footer-links a{background-color:transparent;color:var(--ax-comp-bg,var(--color-on-surface))}.auth-footer-links a.ax-state-selected{color:var(--ax-comp-bg-darker,var(--color-on-surface))}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
21
|
-
}] });
|
|
22
|
-
|
|
23
|
-
export { AXPAuthMasterLayoutComponent };
|
|
24
|
-
//# sourceMappingURL=acorex-platform-module-auth-client-master.layout-DXwb5VSr.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-auth-client-master.layout-DXwb5VSr.mjs","sources":["../../../../libs/modules/auth/client/src/lib/shared/layouts/master/master.layout.ts","../../../../libs/modules/auth/client/src/lib/shared/layouts/master/master.layout.html"],"sourcesContent":["import { AXP_PLATFORM_CONFIG_TOKEN } from '@acorex-platform/framework-client/common';\nimport { AXPLogoComponent } from '@acorex-platform/framework-client/core';\nimport { Component, ViewEncapsulation, inject } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { AXM_AUTH_CONFIG_TOKEN } from '../../../auth.config';\nimport { AXPComponentSlotModule, AXPContextStore } from '@acorex-platform/framework-client/core';\n\n@Component({\n templateUrl: 'master.layout.html',\n styleUrls: ['master.layout.css'],\n imports: [RouterModule, AXPLogoComponent, AXPComponentSlotModule],\n providers: [AXPContextStore],\n encapsulation: ViewEncapsulation.None\n})\nexport class AXPAuthMasterLayoutComponent {\n protected authConfig = inject(AXM_AUTH_CONFIG_TOKEN);\n protected platformConfig = inject(AXP_PLATFORM_CONFIG_TOKEN);\n}\n","<div class=\"w-full h-full flex\">\n <div class=\"flex-1 lightest-surface dark:darker-surface flex flex-col items-center justify-between py-12\">\n <router-outlet></router-outlet>\n <div class=\"flex justify-between\">\n <div class=\"auth-footer-links\">\n <axp-component-slot name=\"auth-footer-links\"></axp-component-slot>\n </div>\n </div>\n </div>\n <div class=\"hidden lg:flex bg-primary-500 flex-1 axp-auth-bk text-white\">\n <div class=\"flex w-full flex-col justify-between px-48 py-20 text-center \">\n <div>\n <axp-logo logoKey=\"platform\" appearance=\"onDark\" format=\"full\" [size]=\"160\" [attr.alt]=\"platformConfig.title\"\n class=\"mx-auto text-2xl\"></axp-logo>\n </div>\n <div>\n <p class=\"font-black text-4xl mb-4\">{{authConfig.signinPage?.slogan}}</p>\n <p>{{authConfig.signinPage?.description}}</p>\n </div>\n </div>\n </div>\n</div>"],"names":["i2"],"mappings":";;;;;;;;;MAca,4BAA4B,CAAA;AAPzC,IAAA,WAAA,GAAA;AAQY,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAC1C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,yBAAyB,CAAC;AAC7D,IAAA;8GAHY,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA5B,4BAA4B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,SAAA,EAH5B,CAAC,eAAe,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECX9B,m7BAqBM,EAAA,MAAA,EAAA,CAAA,2yBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA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4.mjs","sources":["../../../../libs/modules/auth/client/src/lib/pages/callback/oauth-callback.component.ts","../../../../libs/modules/auth/client/src/lib/pages/callback/oauth-callback.component.html"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPAuthStrategyRegistryService, AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPHomePageService } from '@acorex-platform/framework-client/common';\nimport { AXPStateMessageComponent } from '@acorex-platform/framework-client/layout/components';\nimport { CommonModule } from '@angular/common';\nimport { Component, OnInit, inject } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { BehaviorSubject } from 'rxjs';\nimport { AXMAuthConfigs, AXM_AUTH_CONFIG_TOKEN } from '../../auth.config';\n\n@Component({\n selector: 'axp-oauth-callback',\n templateUrl: './oauth-callback.component.html',\n imports: [CommonModule, AXButtonModule, AXLoadingModule, AXTranslationModule, AXPStateMessageComponent],\n standalone: true,\n})\nexport class AXPOAuthCallbackComponent implements OnInit {\n //#region ---- Services & Dependencies ----\n\n private sessionService = inject(AXPSessionService);\n private router = inject(Router);\n private route = inject(ActivatedRoute);\n private homePageService = inject(AXPHomePageService);\n protected configs: AXMAuthConfigs = inject<AXMAuthConfigs>(AXM_AUTH_CONFIG_TOKEN);\n private authStrategyRegistry = inject(AXPAuthStrategyRegistryService);\n private strategyName = this.sessionService.getSessionData()?.strategy;\n private strategy = this.authStrategyRegistry.get(this.strategyName!);\n\n //#endregion\n\n //#region ---- Properties ----\n\n protected isLoading$ = new BehaviorSubject<boolean>(true);\n protected error$ = new BehaviorSubject<string | null>(null);\n protected status$ = new BehaviorSubject<string>('Processing authorization...');\n private exchangeStarted = false;\n // Removed: @Input() flow\n\n //#endregion\n\n //#region ---- Lifecycle Methods ----\n\n async ngOnInit(): Promise<void> {\n if (this.exchangeStarted) {\n return;\n }\n this.exchangeStarted = true;\n\n try {\n const queryParams = this.route.snapshot.queryParams;\n const code = queryParams['code'];\n const error = queryParams['error'];\n // Removed: flowParam and its assignment\n if (error) {\n throw new Error(`OAuth error: ${error} - ${queryParams['error_description'] || 'Unknown error'}`);\n }\n if (!code) {\n throw new Error('No authorization code received from OAuth provider');\n }\n this.status$.next('Exchanging authorization code for tokens...');\n\n const redirectUri = `${window.location.origin}/auth/axp-oauth-callback`;\n await this.sessionService.updateToken({ code, redirectUri });\n this.status$.next('Authentication successful! Redirecting...');\n await this.navigateAfterSuccess();\n } catch (error) {\n console.error('OAuth callback error:', error);\n const message =\n error instanceof Error && error.message.trim()\n ? error.message\n : 'Authentication failed. Please try again.';\n this.error$.next(message);\n await this.sessionService.signout();\n this.isLoading$.next(false);\n } finally {\n this.isLoading$.next(false);\n }\n }\n\n //#endregion\n\n //#region ---- Navigation ----\n\n private async navigateAfterSuccess(): Promise<void> {\n // Use await with router.navigate to ensure navigation completes\n if (this.sessionService.tenant?.id == null) {\n await this.router.navigate(['/auth/account/tenant-chooser']);\n return;\n }\n if (this.sessionService.application?.id == null) {\n await this.router.navigate(['/auth/account/app-chooser']);\n return;\n }\n // Navigate to home page\n await this.homePageService.navigateTo();\n }\n\n //#endregion\n\n //#region ---- UI Handlers ----\n\n protected handleRetry(): void {\n this.router.navigate(['/auth/login']);\n }\n\n protected handleGoHome(): void {\n this.router.navigate(['/']);\n }\n\n //#endregion\n}\n","<ng-container *translate=\"let t\">\n <div class=\"h-full flex flex-col items-center justify-center p-8\">\n <div class=\"w-96 text-center\">\n <!-- Loading State -->\n @if (isLoading$ | async) {\n <axp-state-message\n mode=\"loading\"\n icon=\"fa-solid fa-spinner fa-spin\"\n [title]=\"(status$ | async) || '@auth:state-message.loading.title'\"\n [description]=\"'@auth:state-message.loading.description'\"\n >\n </axp-state-message>\n }\n\n <!-- Error State -->\n @if ((error$ | async) && !(isLoading$ | async)) {\n <axp-state-message\n mode=\"error\"\n icon=\"fa-solid fa-exclamation-triangle\"\n [title]=\"'@auth:state-message.error.title'\"\n [description]=\"(error$ | async) || '@auth:state-message.error.description'\"\n >\n <div slot=\"actions\" class=\"flex flex-col gap-2 sm:flex-row sm:justify-center\">\n <ax-button color=\"primary\" text=\"Try Again\" (onClick)=\"handleRetry()\" class=\"w-full sm:w-auto\">\n </ax-button>\n <ax-button color=\"default\" text=\"Go Home\" (onClick)=\"handleGoHome()\" class=\"w-full sm:w-auto\">\n </ax-button>\n </div>\n </axp-state-message>\n }\n\n <!-- Success State (briefly shown before redirect) -->\n @if (!(isLoading$ | async) && !(error$ | async)) {\n <axp-state-message\n mode=\"success\"\n icon=\"fa-solid fa-check\"\n [title]=\"'@auth:state-message.success.title'\"\n [description]=\"'@auth:state-message.success.description'\"\n >\n </axp-state-message>\n }\n </div>\n </div>\n</ng-container>\n"],"names":["i2","i3"],"mappings":";;;;;;;;;;;;;;;;MAkBa,yBAAyB,CAAA;AANtC,IAAA,WAAA,GAAA;;AASU,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAC1C,QAAA,IAAA,CAAA,OAAO,GAAmB,MAAM,CAAiB,qBAAqB,CAAC;AACzE,QAAA,IAAA,CAAA,oBAAoB,GAAG,MAAM,CAAC,8BAA8B,CAAC;QAC7D,IAAA,CAAA,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE,EAAE,QAAQ;QAC7D,IAAA,CAAA,QAAQ,GAAG,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,YAAa,CAAC;;;AAM1D,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,eAAe,CAAU,IAAI,CAAC;AAC/C,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,eAAe,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