@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.
Files changed (123) hide show
  1. 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
  2. package/fesm2022/acorex-platform-module-auth-client-acorex-platform-module-auth-client-CYmUn-lw.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-auth-client-app-chooser.component-BVbu-f8h.mjs +75 -0
  4. package/fesm2022/acorex-platform-module-auth-client-app-chooser.component-BVbu-f8h.mjs.map +1 -0
  5. package/fesm2022/{acorex-platform-module-auth-client-blank.layout-BRGgntib.mjs → acorex-platform-module-auth-client-blank.layout-BCXNPgrp.mjs} +6 -6
  6. package/fesm2022/acorex-platform-module-auth-client-blank.layout-BCXNPgrp.mjs.map +1 -0
  7. 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
  8. package/fesm2022/acorex-platform-module-auth-client-change-password.command-DIM_d7RO.mjs.map +1 -0
  9. package/fesm2022/acorex-platform-module-auth-client-change-photo.command-CYGqrJV0.mjs +257 -0
  10. package/fesm2022/acorex-platform-module-auth-client-change-photo.command-CYGqrJV0.mjs.map +1 -0
  11. package/fesm2022/acorex-platform-module-auth-client-contracts.mjs +46 -10
  12. package/fesm2022/acorex-platform-module-auth-client-contracts.mjs.map +1 -1
  13. 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
  14. package/fesm2022/acorex-platform-module-auth-client-edit-account-info.command-CD9IrimO.mjs.map +1 -0
  15. package/fesm2022/{acorex-platform-module-auth-client-edit-signature.command-CcTJJwAX.mjs → acorex-platform-module-auth-client-edit-signature.command-TjOLhvKL.mjs} +5 -5
  16. package/fesm2022/acorex-platform-module-auth-client-edit-signature.command-TjOLhvKL.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-module-auth-client-get-user-activity.query-BTpibxe9.mjs +80 -0
  18. package/fesm2022/acorex-platform-module-auth-client-get-user-activity.query-BTpibxe9.mjs.map +1 -0
  19. package/fesm2022/{acorex-platform-module-auth-client-lock-screen.command-PMoJJxe7.mjs → acorex-platform-module-auth-client-lock-screen.command-Br9O4b5c.mjs} +6 -6
  20. package/fesm2022/acorex-platform-module-auth-client-lock-screen.command-Br9O4b5c.mjs.map +1 -0
  21. package/fesm2022/{acorex-platform-module-auth-client-login.module-C4S0RjM7.mjs → acorex-platform-module-auth-client-login.module-DJVL3bAF.mjs} +8 -21
  22. package/fesm2022/acorex-platform-module-auth-client-login.module-DJVL3bAF.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-module-auth-client-master.layout-DZUYm22p.mjs +39 -0
  24. package/fesm2022/acorex-platform-module-auth-client-master.layout-DZUYm22p.mjs.map +1 -0
  25. package/fesm2022/{acorex-platform-module-auth-client-oauth-callback.component-CEMvfjj4.mjs → acorex-platform-module-auth-client-oauth-callback.component-DnQzPUxF.mjs} +11 -15
  26. package/fesm2022/acorex-platform-module-auth-client-oauth-callback.component-DnQzPUxF.mjs.map +1 -0
  27. package/fesm2022/acorex-platform-module-auth-client-open-sessions.command-LZKM9fgo.mjs +200 -0
  28. package/fesm2022/acorex-platform-module-auth-client-open-sessions.command-LZKM9fgo.mjs.map +1 -0
  29. package/fesm2022/{acorex-platform-module-auth-client-password.component-CIr6IBG6.mjs → acorex-platform-module-auth-client-password.component-CNKRWfuG.mjs} +86 -45
  30. package/fesm2022/acorex-platform-module-auth-client-password.component-CNKRWfuG.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-module-auth-client-password.component-CW0t9fEn.mjs +87 -0
  32. package/fesm2022/acorex-platform-module-auth-client-password.component-CW0t9fEn.mjs.map +1 -0
  33. package/fesm2022/acorex-platform-module-auth-client-platform-settings-unavailable.component-BEVkQ3jh.mjs +47 -0
  34. package/fesm2022/acorex-platform-module-auth-client-platform-settings-unavailable.component-BEVkQ3jh.mjs.map +1 -0
  35. 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
  36. package/fesm2022/acorex-platform-module-auth-client-profile-activity-chart.component-CtSrYARX.mjs.map +1 -0
  37. 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
  38. package/fesm2022/acorex-platform-module-auth-client-profile-coming-soon.command-Crh2GsRA.mjs.map +1 -0
  39. 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
  40. 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
  41. 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
  42. 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
  43. package/fesm2022/acorex-platform-module-auth-client-profile-page.component-CdxseoJX.mjs +650 -0
  44. package/fesm2022/acorex-platform-module-auth-client-profile-page.component-CdxseoJX.mjs.map +1 -0
  45. 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
  46. package/fesm2022/acorex-platform-module-auth-client-register-password.component-D-tBrCJv.mjs.map +1 -0
  47. package/fesm2022/{acorex-platform-module-auth-client-register.module--DG9m8iC.mjs → acorex-platform-module-auth-client-register.module-BrXqva0B.mjs} +23 -23
  48. package/fesm2022/acorex-platform-module-auth-client-register.module-BrXqva0B.mjs.map +1 -0
  49. 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
  50. package/fesm2022/acorex-platform-module-auth-client-remove-pin-code.command-uK04-h15.mjs.map +1 -0
  51. package/fesm2022/acorex-platform-module-auth-client-reset-password.component-CcwDb6Wb.mjs +115 -0
  52. package/fesm2022/acorex-platform-module-auth-client-reset-password.component-CcwDb6Wb.mjs.map +1 -0
  53. package/fesm2022/{acorex-platform-module-auth-client-result.component-DYJaB-FD.mjs → acorex-platform-module-auth-client-result.component-DWv1hmQR.mjs} +6 -6
  54. package/fesm2022/acorex-platform-module-auth-client-result.component-DWv1hmQR.mjs.map +1 -0
  55. package/fesm2022/{acorex-platform-module-auth-client-routes-DVN2Y2Ps.mjs → acorex-platform-module-auth-client-routes-IX2qmeqU.mjs} +3 -3
  56. package/fesm2022/{acorex-platform-module-auth-client-routes-DVN2Y2Ps.mjs.map → acorex-platform-module-auth-client-routes-IX2qmeqU.mjs.map} +1 -1
  57. package/fesm2022/acorex-platform-module-auth-client-session-lock-overlay.component-BhsTAmVe.mjs +361 -0
  58. package/fesm2022/acorex-platform-module-auth-client-session-lock-overlay.component-BhsTAmVe.mjs.map +1 -0
  59. package/fesm2022/acorex-platform-module-auth-client-set-pin-code.command-BJT7F-xz.mjs +116 -0
  60. package/fesm2022/acorex-platform-module-auth-client-set-pin-code.command-BJT7F-xz.mjs.map +1 -0
  61. 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
  62. package/fesm2022/acorex-platform-module-auth-client-set-pin-code.component-Cq4skm_3.mjs.map +1 -0
  63. package/fesm2022/{acorex-platform-module-auth-client-settings.provider-n1qbs6e1.mjs → acorex-platform-module-auth-client-settings.provider-Yaoz8yp3.mjs} +139 -11
  64. package/fesm2022/acorex-platform-module-auth-client-settings.provider-Yaoz8yp3.mjs.map +1 -0
  65. package/fesm2022/{acorex-platform-module-auth-client-show-profile-command-CxMz1yy-.mjs → acorex-platform-module-auth-client-show-profile-command-BWoDxIdx.mjs} +5 -6
  66. package/fesm2022/acorex-platform-module-auth-client-show-profile-command-BWoDxIdx.mjs.map +1 -0
  67. package/fesm2022/{acorex-platform-module-auth-client-signout-command-DqqrP5pk.mjs → acorex-platform-module-auth-client-signout-command-B7n_Fn4P.mjs} +5 -5
  68. package/fesm2022/acorex-platform-module-auth-client-signout-command-B7n_Fn4P.mjs.map +1 -0
  69. package/fesm2022/acorex-platform-module-auth-client-tenant-chooser.component-CHmg7D5H.mjs +67 -0
  70. package/fesm2022/acorex-platform-module-auth-client-tenant-chooser.component-CHmg7D5H.mjs.map +1 -0
  71. package/fesm2022/acorex-platform-module-auth-client-two-factor-code.component-nsB4v25Z.mjs +40 -0
  72. package/fesm2022/acorex-platform-module-auth-client-two-factor-code.component-nsB4v25Z.mjs.map +1 -0
  73. package/fesm2022/{acorex-platform-module-auth-client-two-factor.module-FAqKbmBb.mjs → acorex-platform-module-auth-client-two-factor.module-_jYo6xXr.mjs} +8 -11
  74. package/fesm2022/acorex-platform-module-auth-client-two-factor.module-_jYo6xXr.mjs.map +1 -0
  75. 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
  76. package/fesm2022/acorex-platform-module-auth-client-view-login-history.command-ovj5rdHL.mjs.map +1 -0
  77. package/fesm2022/acorex-platform-module-auth-client.mjs +1 -1
  78. package/package.json +1 -1
  79. package/types/acorex-platform-module-auth-client-contracts.d.ts +43 -9
  80. package/types/acorex-platform-module-auth-client.d.ts +63 -56
  81. package/fesm2022/acorex-platform-module-auth-client-acorex-platform-module-auth-client-mW7tx8C0.mjs.map +0 -1
  82. package/fesm2022/acorex-platform-module-auth-client-app-chooser.component-IPLp1kVv.mjs +0 -67
  83. package/fesm2022/acorex-platform-module-auth-client-app-chooser.component-IPLp1kVv.mjs.map +0 -1
  84. package/fesm2022/acorex-platform-module-auth-client-blank.layout-BRGgntib.mjs.map +0 -1
  85. package/fesm2022/acorex-platform-module-auth-client-change-password.command-O8Mgxoqj.mjs.map +0 -1
  86. package/fesm2022/acorex-platform-module-auth-client-change-photo.command-BcNq9mTU.mjs +0 -192
  87. package/fesm2022/acorex-platform-module-auth-client-change-photo.command-BcNq9mTU.mjs.map +0 -1
  88. package/fesm2022/acorex-platform-module-auth-client-edit-account-info.command-B-mVlXxg.mjs.map +0 -1
  89. package/fesm2022/acorex-platform-module-auth-client-edit-signature.command-CcTJJwAX.mjs.map +0 -1
  90. package/fesm2022/acorex-platform-module-auth-client-lock-screen.command-PMoJJxe7.mjs.map +0 -1
  91. package/fesm2022/acorex-platform-module-auth-client-login.module-C4S0RjM7.mjs.map +0 -1
  92. package/fesm2022/acorex-platform-module-auth-client-master.layout-DXwb5VSr.mjs +0 -24
  93. package/fesm2022/acorex-platform-module-auth-client-master.layout-DXwb5VSr.mjs.map +0 -1
  94. package/fesm2022/acorex-platform-module-auth-client-oauth-callback.component-CEMvfjj4.mjs.map +0 -1
  95. package/fesm2022/acorex-platform-module-auth-client-open-sessions.command-BsS9b6Xk.mjs +0 -196
  96. package/fesm2022/acorex-platform-module-auth-client-open-sessions.command-BsS9b6Xk.mjs.map +0 -1
  97. package/fesm2022/acorex-platform-module-auth-client-password.component-CIr6IBG6.mjs.map +0 -1
  98. package/fesm2022/acorex-platform-module-auth-client-password.component-DnFItGdA.mjs +0 -88
  99. package/fesm2022/acorex-platform-module-auth-client-password.component-DnFItGdA.mjs.map +0 -1
  100. package/fesm2022/acorex-platform-module-auth-client-profile-activity-chart.component-DTY1eEI_.mjs.map +0 -1
  101. package/fesm2022/acorex-platform-module-auth-client-profile-coming-soon.command-DBbFbzAx.mjs.map +0 -1
  102. package/fesm2022/acorex-platform-module-auth-client-profile-page.component-CJ9AA3ZN.mjs +0 -446
  103. package/fesm2022/acorex-platform-module-auth-client-profile-page.component-CJ9AA3ZN.mjs.map +0 -1
  104. package/fesm2022/acorex-platform-module-auth-client-register-password.component-ia6tdvTc.mjs.map +0 -1
  105. package/fesm2022/acorex-platform-module-auth-client-register.module--DG9m8iC.mjs.map +0 -1
  106. package/fesm2022/acorex-platform-module-auth-client-remove-pin-code.command-qtswigkv.mjs.map +0 -1
  107. package/fesm2022/acorex-platform-module-auth-client-reset-password.component-CTlrt_18.mjs +0 -115
  108. package/fesm2022/acorex-platform-module-auth-client-reset-password.component-CTlrt_18.mjs.map +0 -1
  109. package/fesm2022/acorex-platform-module-auth-client-result.component-DYJaB-FD.mjs.map +0 -1
  110. package/fesm2022/acorex-platform-module-auth-client-session-lock-overlay.component-CN1JqPBW.mjs +0 -346
  111. package/fesm2022/acorex-platform-module-auth-client-session-lock-overlay.component-CN1JqPBW.mjs.map +0 -1
  112. package/fesm2022/acorex-platform-module-auth-client-set-pin-code.command-mBEdso1T.mjs +0 -33
  113. package/fesm2022/acorex-platform-module-auth-client-set-pin-code.command-mBEdso1T.mjs.map +0 -1
  114. package/fesm2022/acorex-platform-module-auth-client-set-pin-code.component-BHVqbYFv.mjs.map +0 -1
  115. package/fesm2022/acorex-platform-module-auth-client-settings.provider-n1qbs6e1.mjs.map +0 -1
  116. package/fesm2022/acorex-platform-module-auth-client-show-profile-command-CxMz1yy-.mjs.map +0 -1
  117. package/fesm2022/acorex-platform-module-auth-client-signout-command-DqqrP5pk.mjs.map +0 -1
  118. package/fesm2022/acorex-platform-module-auth-client-tenant-chooser.component-B_9s4F36.mjs +0 -59
  119. package/fesm2022/acorex-platform-module-auth-client-tenant-chooser.component-B_9s4F36.mjs.map +0 -1
  120. package/fesm2022/acorex-platform-module-auth-client-two-factor-code.component-DAxlYlhM.mjs +0 -40
  121. package/fesm2022/acorex-platform-module-auth-client-two-factor-code.component-DAxlYlhM.mjs.map +0 -1
  122. package/fesm2022/acorex-platform-module-auth-client-two-factor.module-FAqKbmBb.mjs.map +0 -1
  123. package/fesm2022/acorex-platform-module-auth-client-view-login-history.command-B42BHIAL.mjs.map +0 -1
@@ -0,0 +1,116 @@
1
+ import { AXDialogService } from '@acorex/components/dialog';
2
+ import { AXPopupService } from '@acorex/components/popup';
3
+ import { AXToastService } from '@acorex/components/toast';
4
+ import { AXTranslationService } from '@acorex/core/translation';
5
+ import { AXPSettingsService } from '@acorex-platform/framework-client/common';
6
+ import { AXPPlatformScope } from '@acorex-platform/framework-shared/core';
7
+ import { AXPAuthSettings } from '@acorex-platform/module-auth-client/contracts';
8
+ import * as i0 from '@angular/core';
9
+ import { inject, Injectable } from '@angular/core';
10
+ import { i as AXPIdleLockService } from './acorex-platform-module-auth-client-acorex-platform-module-auth-client-CYmUn-lw.mjs';
11
+
12
+ //#region ---- Set PIN code command ----
13
+ /** Opens the step-by-step security PIN setup popup for the current user. */
14
+ class AXPSetPinCodeCommand {
15
+ constructor() {
16
+ //#region ---- Services & Dependencies ----
17
+ this.popupService = inject(AXPopupService);
18
+ this.dialogService = inject(AXDialogService);
19
+ this.translateService = inject(AXTranslationService);
20
+ this.toastService = inject(AXToastService);
21
+ this.settingsService = inject(AXPSettingsService);
22
+ this.idleLockService = inject(AXPIdleLockService);
23
+ }
24
+ //#endregion
25
+ //#region ---- Command ----
26
+ async execute() {
27
+ const { AXMSetPinCodeComponent } = await import('./acorex-platform-module-auth-client-set-pin-code.component-Cq4skm_3.mjs');
28
+ const popupResult = await this.popupService.open(AXMSetPinCodeComponent, {
29
+ title: await this.translateService.translateAsync('@auth:profile-page.commands.set-pin-code.dialog.title'),
30
+ size: 'sm',
31
+ });
32
+ if (this.idleLockService.consumeLockScreenOffer() || this.isSuccessfulPinSave(popupResult)) {
33
+ await this.afterPinSaved();
34
+ }
35
+ return { success: true, kind: 'object', data: undefined };
36
+ }
37
+ //#endregion
38
+ //#region ---- Private Methods ----
39
+ isSuccessfulPinSave(popupResult) {
40
+ if (!popupResult || typeof popupResult !== 'object') {
41
+ return false;
42
+ }
43
+ const root = popupResult;
44
+ if (root['success'] === true) {
45
+ return true;
46
+ }
47
+ const data = root['data'];
48
+ if (!data || typeof data !== 'object') {
49
+ return false;
50
+ }
51
+ const nested = data;
52
+ if (nested['success'] === true) {
53
+ return true;
54
+ }
55
+ const inner = nested['data'];
56
+ return Boolean(inner && typeof inner === 'object' && inner['success'] === true);
57
+ }
58
+ async afterPinSaved() {
59
+ await this.idleLockService.refreshLockMenuState();
60
+ if (this.idleLockService.canLock()) {
61
+ await this.idleLockService.notifyPinChanged();
62
+ await this.showLockActiveAlert();
63
+ return;
64
+ }
65
+ await this.offerLockScreenActivation();
66
+ }
67
+ async offerLockScreenActivation() {
68
+ const dialogResult = await this.dialogService.show({
69
+ title: '@auth:profile-page.commands.set-pin-code.activate-lock-screen.dialog.title',
70
+ content: '@auth:profile-page.commands.set-pin-code.activate-lock-screen.dialog.description',
71
+ type: 'primary',
72
+ orientation: 'horizontal',
73
+ buttons: [
74
+ {
75
+ name: 'confirm',
76
+ text: '@auth:profile-page.commands.set-pin-code.activate-lock-screen.actions.activate',
77
+ color: 'primary',
78
+ autofocus: true,
79
+ },
80
+ {
81
+ name: 'cancel',
82
+ text: '@auth:profile-page.commands.set-pin-code.activate-lock-screen.actions.not-now',
83
+ color: 'default',
84
+ },
85
+ ],
86
+ });
87
+ if (dialogResult?.name !== 'confirm') {
88
+ return;
89
+ }
90
+ try {
91
+ await this.settingsService
92
+ .scope(AXPPlatformScope.User)
93
+ .set(AXPAuthSettings.LockWhenIdleEnabled, true, { flush: true });
94
+ await this.idleLockService.notifyPinChanged();
95
+ await this.showLockActiveAlert();
96
+ }
97
+ catch (error) {
98
+ console.error('Failed to activate lock screen after PIN setup', error);
99
+ const content = await this.translateService.translateAsync('@auth:profile-page.commands.set-pin-code.activate-lock-screen.messages.activate-failed');
100
+ const title = await this.translateService.translateAsync('@general:messages.generic.error.title');
101
+ this.toastService.show({ color: 'danger', title, content, closeButton: true });
102
+ }
103
+ }
104
+ async showLockActiveAlert() {
105
+ await this.dialogService.alert('@auth:profile-page.commands.set-pin-code.activate-lock-screen.alert.title', '@auth:profile-page.commands.set-pin-code.activate-lock-screen.alert.description', 'success', 'horizontal');
106
+ }
107
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPSetPinCodeCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
108
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPSetPinCodeCommand, providedIn: 'root' }); }
109
+ }
110
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPSetPinCodeCommand, decorators: [{
111
+ type: Injectable,
112
+ args: [{ providedIn: 'root' }]
113
+ }] });
114
+
115
+ export { AXPSetPinCodeCommand };
116
+ //# sourceMappingURL=acorex-platform-module-auth-client-set-pin-code.command-BJT7F-xz.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-auth-client-set-pin-code.command-BJT7F-xz.mjs","sources":["../../../../libs/modules/auth/client/src/lib/commands/set-pin-code.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXDialogService } from '@acorex/components/dialog';\nimport { AXPopupService } from '@acorex/components/popup';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { AXPPlatformScope } from '@acorex-platform/framework-shared/core';\nimport { AXPAuthSettings } from '@acorex-platform/module-auth-client/contracts';\n\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXPIdleLockService } from '../shared/services/idle-lock.service';\n\n//#region ---- Set PIN code command ----\n\n/** Opens the step-by-step security PIN setup popup for the current user. */\n@Injectable({ providedIn: 'root' })\nexport class AXPSetPinCodeCommand implements AXPCommand {\n //#region ---- Services & Dependencies ----\n\n private readonly popupService = inject(AXPopupService);\n private readonly dialogService = inject(AXDialogService);\n private readonly translateService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly settingsService = inject(AXPSettingsService);\n private readonly idleLockService = inject(AXPIdleLockService);\n\n //#endregion\n\n //#region ---- Command ----\n\n async execute(): AXPCommandExecuteResultPromise<void> {\n const { AXMSetPinCodeComponent } = await import('../pages/account/set-pin-code/set-pin-code.component');\n\n const popupResult = await this.popupService.open(AXMSetPinCodeComponent, {\n title: await this.translateService.translateAsync('@auth:profile-page.commands.set-pin-code.dialog.title'),\n size: 'sm',\n });\n\n if (this.idleLockService.consumeLockScreenOffer() || this.isSuccessfulPinSave(popupResult)) {\n await this.afterPinSaved();\n }\n\n return { success: true, kind: 'object', data: undefined };\n }\n\n //#endregion\n\n //#region ---- Private Methods ----\n\n private isSuccessfulPinSave(popupResult: unknown): boolean {\n if (!popupResult || typeof popupResult !== 'object') {\n return false;\n }\n\n const root = popupResult as Record<string, unknown>;\n if (root['success'] === true) {\n return true;\n }\n\n const data = root['data'];\n if (!data || typeof data !== 'object') {\n return false;\n }\n\n const nested = data as Record<string, unknown>;\n if (nested['success'] === true) {\n return true;\n }\n\n const inner = nested['data'];\n return Boolean(inner && typeof inner === 'object' && (inner as Record<string, unknown>)['success'] === true);\n }\n\n private async afterPinSaved(): Promise<void> {\n await this.idleLockService.refreshLockMenuState();\n\n if (this.idleLockService.canLock()) {\n await this.idleLockService.notifyPinChanged();\n await this.showLockActiveAlert();\n return;\n }\n\n await this.offerLockScreenActivation();\n }\n\n private async offerLockScreenActivation(): Promise<void> {\n const dialogResult = await this.dialogService.show({\n title: '@auth:profile-page.commands.set-pin-code.activate-lock-screen.dialog.title',\n content: '@auth:profile-page.commands.set-pin-code.activate-lock-screen.dialog.description',\n type: 'primary',\n orientation: 'horizontal',\n buttons: [\n {\n name: 'confirm',\n text: '@auth:profile-page.commands.set-pin-code.activate-lock-screen.actions.activate',\n color: 'primary',\n autofocus: true,\n },\n {\n name: 'cancel',\n text: '@auth:profile-page.commands.set-pin-code.activate-lock-screen.actions.not-now',\n color: 'default',\n },\n ],\n });\n\n if (dialogResult?.name !== 'confirm') {\n return;\n }\n\n try {\n await this.settingsService\n .scope(AXPPlatformScope.User)\n .set(AXPAuthSettings.LockWhenIdleEnabled, true, { flush: true });\n await this.idleLockService.notifyPinChanged();\n await this.showLockActiveAlert();\n } catch (error) {\n console.error('Failed to activate lock screen after PIN setup', error);\n const content = await this.translateService.translateAsync(\n '@auth:profile-page.commands.set-pin-code.activate-lock-screen.messages.activate-failed',\n );\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\n private async showLockActiveAlert(): Promise<void> {\n await this.dialogService.alert(\n '@auth:profile-page.commands.set-pin-code.activate-lock-screen.alert.title',\n '@auth:profile-page.commands.set-pin-code.activate-lock-screen.alert.description',\n 'success',\n 'horizontal',\n );\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;AAaA;AAEA;MAEa,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AACvC,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAC/C,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAC5C,QAAA,IAAA,CAAA,eAAe,GA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AC,gBAAgB,EAAE;AAC7C,YAAA,MAAM,IAAI,CAAC,mBAAmB,EAAE;QAClC;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,OAAO,CAAC,KAAK,CAAC,gDAAgD,EAAE,KAAK,CAAC;YACtE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CACxD,wFAAwF,CACzF;YACD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,uCAAuC,CAAC;AACjG,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;QAChF;IACF;AAEQ,IAAA,MAAM,mBAAmB,GAAA;AAC/B,QAAA,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAC5B,2EAA2E,EAC3E,iFAAiF,EACjF,SAAS,EACT,YAAY,CACb;IACH;8GArHW,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;;;;;"}
@@ -7,12 +7,12 @@ import * as i4 from '@acorex/components/otp';
7
7
  import { AXOtpComponent, AXOtpModule } from '@acorex/components/otp';
8
8
  import { AXBasePageComponent } from '@acorex/components/page';
9
9
  import { AXToastService } from '@acorex/components/toast';
10
- import * as i7 from '@acorex/core/translation';
10
+ import * as i5 from '@acorex/core/translation';
11
11
  import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
12
12
  import { RootConfig } from '@acorex-platform/module-security-management-client/contracts';
13
13
  import { AXPSessionService } from '@acorex-platform/framework-client/auth';
14
14
  import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
15
- import * as i6 from '@angular/common';
15
+ import * as i3$1 from '@angular/common';
16
16
  import { CommonModule } from '@angular/common';
17
17
  import * as i0 from '@angular/core';
18
18
  import { signal, computed, viewChild, inject, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
@@ -20,7 +20,7 @@ import * as i1 from '@angular/forms';
20
20
  import { FormsModule } from '@angular/forms';
21
21
  import { defaultTo, isNil, get, isEmpty } from 'lodash';
22
22
  import { A as AXP_AUTH_PIN_CODE_LENGTH, a as AXP_AUTH_PIN_CODE_PATTERN } from './acorex-platform-module-auth-client-pin-code.constants-CRsFG7fg.mjs';
23
- import { f as AXPIdleLockService } from './acorex-platform-module-auth-client-acorex-platform-module-auth-client-mW7tx8C0.mjs';
23
+ import { i as AXPIdleLockService } from './acorex-platform-module-auth-client-acorex-platform-module-auth-client-CYmUn-lw.mjs';
24
24
 
25
25
  //#endregion
26
26
  class AXMSetPinCodeComponent extends AXBasePageComponent {
@@ -32,17 +32,25 @@ class AXMSetPinCodeComponent extends AXBasePageComponent {
32
32
  this.pinLength = AXP_AUTH_PIN_CODE_LENGTH;
33
33
  //#endregion
34
34
  //#region ---- State ----
35
- this.step = signal('enter', ...(ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []));
36
- this.pinInput = signal('', ...(ngDevMode ? [{ debugName: "pinInput" }] : /* istanbul ignore next */ []));
37
- this.draftPin = signal('', ...(ngDevMode ? [{ debugName: "draftPin" }] : /* istanbul ignore next */ []));
38
- this.hasExistingPin = signal(false, ...(ngDevMode ? [{ debugName: "hasExistingPin" }] : /* istanbul ignore next */ []));
39
- this.isSaving = signal(false, ...(ngDevMode ? [{ debugName: "isSaving" }] : /* istanbul ignore next */ []));
40
- this.storedPinCode = signal('', ...(ngDevMode ? [{ debugName: "storedPinCode" }] : /* istanbul ignore next */ []));
35
+ this.step = signal('enter', /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []));
37
+ this.pinInput = signal('', /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "pinInput" }] : /* istanbul ignore next */ []));
39
+ this.draftPin = signal('', /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "draftPin" }] : /* istanbul ignore next */ []));
41
+ this.hasExistingPin = signal(false, /* @ts-ignore */
42
+ ...(ngDevMode ? [{ debugName: "hasExistingPin" }] : /* istanbul ignore next */ []));
43
+ this.isSaving = signal(false, /* @ts-ignore */
44
+ ...(ngDevMode ? [{ debugName: "isSaving" }] : /* istanbul ignore next */ []));
45
+ this.storedPinCode = signal('', /* @ts-ignore */
46
+ ...(ngDevMode ? [{ debugName: "storedPinCode" }] : /* istanbul ignore next */ []));
41
47
  this.isAdvancing = false;
42
- this.canProceed = computed(() => AXP_AUTH_PIN_CODE_PATTERN.test(this.pinInput()), ...(ngDevMode ? [{ debugName: "canProceed" }] : /* istanbul ignore next */ []));
48
+ this.canProceed = computed(() => AXP_AUTH_PIN_CODE_PATTERN.test(this.pinInput()), /* @ts-ignore */
49
+ ...(ngDevMode ? [{ debugName: "canProceed" }] : /* istanbul ignore next */ []));
43
50
  //#endregion
44
51
  //#region ---- View children ----
45
- this.otpInput = viewChild(AXOtpComponent, ...(ngDevMode ? [{ debugName: "otpInput" }] : /* istanbul ignore next */ []));
52
+ this.otpInput = viewChild(AXOtpComponent, /* @ts-ignore */
53
+ ...(ngDevMode ? [{ debugName: "otpInput" }] : /* istanbul ignore next */ []));
46
54
  //#endregion
47
55
  //#region ---- Services & Dependencies ----
48
56
  this.entityService = inject(AXPEntityService);
@@ -150,12 +158,13 @@ class AXMSetPinCodeComponent extends AXBasePageComponent {
150
158
  }
151
159
  this.isSaving.set(true);
152
160
  try {
153
- await this.getUserData().update(userId, { pinCode: pin });
154
- if (this.idleLockService.canLock()) {
155
- await this.idleLockService.notifyPinChanged();
156
- }
161
+ await this.getUserData().update(userId, {
162
+ pinCode: pin,
163
+ pinChangedAt: new Date().toISOString(),
164
+ });
157
165
  const successTitle = await this.translateService.translateAsync('@auth:profile-page.commands.set-pin-code.messages.success');
158
166
  this.toastService.show({ color: 'success', title: successTitle });
167
+ this.idleLockService.requestLockScreenOffer();
159
168
  this.close({ success: true });
160
169
  }
161
170
  catch (error) {
@@ -176,13 +185,13 @@ class AXMSetPinCodeComponent extends AXBasePageComponent {
176
185
  const title = await this.translateService.translateAsync('@general:messages.generic.error.title');
177
186
  this.toastService.show({ color: 'danger', title, content, closeButton: true });
178
187
  }
179
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMSetPinCodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
180
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXMSetPinCodeComponent, isStandalone: true, selector: "axm-set-pin-code", viewQueries: [{ propertyName: "otpInput", first: true, predicate: AXOtpComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ax-content>\n <div class=\"axm-set-pin-code__content flex flex-col items-center gap-4 p-6 text-center\">\n <div class=\"axm-set-pin-code__intro flex flex-col gap-2\">\n <h2 class=\"m-0 text-base font-semibold text-on-lightest\">\n @switch (step()) {\n @case ('verify-current') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.verify-current.title' | translate | async }}\n }\n @case ('enter') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.enter.title' | translate | async }}\n }\n @case ('confirm') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.confirm.title' | translate | async }}\n }\n }\n </h2>\n <p class=\"m-0 text-sm text-on-lighter-surface\">\n @switch (step()) {\n @case ('verify-current') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.verify-current.description' | translate | async }}\n }\n @case ('enter') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.enter.description' | translate | async }}\n }\n @case ('confirm') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.confirm.description' | translate | async }}\n }\n }\n </p>\n </div>\n\n <div class=\"axm-set-pin-code__otp w-full max-w-xs\">\n <ax-otp\n class=\"w-full block\"\n type=\"number\"\n [length]=\"pinLength\"\n [ngModel]=\"pinInput()\"\n (ngModelChange)=\"onPinInputChange($event)\"\n (onCompleted)=\"onPinCompleted($event)\"\n ></ax-otp>\n </div>\n </div>\n</ax-content>\n\n<ax-footer>\n <ax-suffix>\n @if (step() === 'confirm') {\n <ax-button\n look=\"solid\"\n color=\"default\"\n [text]=\"'@general:actions.back.title' | translate | async\"\n [disabled]=\"isSaving()\"\n (onClick)=\"onBack()\"\n ></ax-button>\n }\n\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"\n (step() === 'confirm'\n ? '@auth:profile-page.commands.set-pin-code.actions.save'\n : '@general:actions.next.title'\n )\n | translate\n | async\n \"\n [disabled]=\"!canProceed() || isSaving()\"\n (onClick)=\"onNext()\"\n ></ax-button>\n </ax-suffix>\n</ax-footer>\n", styles: [".axm-set-pin-code .axm-set-pin-code__content{box-sizing:border-box}.axm-set-pin-code .axm-set-pin-code__intro{max-width:calc(var(--spacing, .25rem) * 80)}.axm-set-pin-code .axm-set-pin-code__otp{box-sizing:border-box}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$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: i3.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: AXOtpModule }, { kind: "component", type: i4.AXOtpComponent, selector: "ax-otp", inputs: ["state", "disabled", "readonly", "look", "name", "type", "mode", "length"], outputs: ["stateChange", "disabledChange", "lengthChange", "onCompleted"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i7.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
188
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMSetPinCodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
189
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMSetPinCodeComponent, isStandalone: true, selector: "axm-set-pin-code", viewQueries: [{ propertyName: "otpInput", first: true, predicate: AXOtpComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ax-content>\n <div class=\"axm-set-pin-code__content flex flex-col items-center gap-4 p-6 text-center\">\n <div class=\"axm-set-pin-code__intro flex flex-col gap-2\">\n <h2 class=\"m-0 text-base font-semibold text-on-lightest\">\n @switch (step()) {\n @case ('verify-current') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.verify-current.title' | translate | async }}\n }\n @case ('enter') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.enter.title' | translate | async }}\n }\n @case ('confirm') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.confirm.title' | translate | async }}\n }\n }\n </h2>\n <p class=\"m-0 text-sm text-on-lighter-surface\">\n @switch (step()) {\n @case ('verify-current') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.verify-current.description' | translate | async }}\n }\n @case ('enter') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.enter.description' | translate | async }}\n }\n @case ('confirm') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.confirm.description' | translate | async }}\n }\n }\n </p>\n </div>\n\n <div class=\"axm-set-pin-code__otp w-full max-w-xs\">\n <ax-otp\n class=\"w-full block\"\n type=\"number\"\n [length]=\"pinLength\"\n [ngModel]=\"pinInput()\"\n (ngModelChange)=\"onPinInputChange($event)\"\n (onCompleted)=\"onPinCompleted($event)\"\n ></ax-otp>\n </div>\n </div>\n</ax-content>\n\n<ax-footer>\n <ax-suffix>\n @if (step() === 'confirm') {\n <ax-button\n look=\"solid\"\n color=\"default\"\n [text]=\"'@general:actions.back.title' | translate | async\"\n [disabled]=\"isSaving()\"\n (onClick)=\"onBack()\"\n ></ax-button>\n }\n\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"\n (step() === 'confirm'\n ? '@auth:profile-page.commands.set-pin-code.actions.save'\n : '@general:actions.next.title'\n )\n | translate\n | async\n \"\n [disabled]=\"!canProceed() || isSaving()\"\n (onClick)=\"onNext()\"\n ></ax-button>\n </ax-suffix>\n</ax-footer>\n", styles: [".axm-set-pin-code .axm-set-pin-code__content{box-sizing:border-box}.axm-set-pin-code .axm-set-pin-code__intro{max-width:calc(var(--spacing, .25rem) * 80)}.axm-set-pin-code .axm-set-pin-code__otp{box-sizing:border-box}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$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: i3.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: AXOtpModule }, { kind: "component", type: i4.AXOtpComponent, selector: "ax-otp", inputs: ["state", "disabled", "readonly", "look", "name", "type", "mode", "length"], outputs: ["stateChange", "disabledChange", "lengthChange", "onCompleted"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
181
190
  }
182
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMSetPinCodeComponent, decorators: [{
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMSetPinCodeComponent, decorators: [{
183
192
  type: Component,
184
- args: [{ selector: 'axm-set-pin-code', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CommonModule, FormsModule, AXFormModule, AXButtonModule, AXDecoratorModule, AXOtpModule, AXTranslationModule], template: "<ax-content>\n <div class=\"axm-set-pin-code__content flex flex-col items-center gap-4 p-6 text-center\">\n <div class=\"axm-set-pin-code__intro flex flex-col gap-2\">\n <h2 class=\"m-0 text-base font-semibold text-on-lightest\">\n @switch (step()) {\n @case ('verify-current') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.verify-current.title' | translate | async }}\n }\n @case ('enter') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.enter.title' | translate | async }}\n }\n @case ('confirm') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.confirm.title' | translate | async }}\n }\n }\n </h2>\n <p class=\"m-0 text-sm text-on-lighter-surface\">\n @switch (step()) {\n @case ('verify-current') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.verify-current.description' | translate | async }}\n }\n @case ('enter') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.enter.description' | translate | async }}\n }\n @case ('confirm') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.confirm.description' | translate | async }}\n }\n }\n </p>\n </div>\n\n <div class=\"axm-set-pin-code__otp w-full max-w-xs\">\n <ax-otp\n class=\"w-full block\"\n type=\"number\"\n [length]=\"pinLength\"\n [ngModel]=\"pinInput()\"\n (ngModelChange)=\"onPinInputChange($event)\"\n (onCompleted)=\"onPinCompleted($event)\"\n ></ax-otp>\n </div>\n </div>\n</ax-content>\n\n<ax-footer>\n <ax-suffix>\n @if (step() === 'confirm') {\n <ax-button\n look=\"solid\"\n color=\"default\"\n [text]=\"'@general:actions.back.title' | translate | async\"\n [disabled]=\"isSaving()\"\n (onClick)=\"onBack()\"\n ></ax-button>\n }\n\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"\n (step() === 'confirm'\n ? '@auth:profile-page.commands.set-pin-code.actions.save'\n : '@general:actions.next.title'\n )\n | translate\n | async\n \"\n [disabled]=\"!canProceed() || isSaving()\"\n (onClick)=\"onNext()\"\n ></ax-button>\n </ax-suffix>\n</ax-footer>\n", styles: [".axm-set-pin-code .axm-set-pin-code__content{box-sizing:border-box}.axm-set-pin-code .axm-set-pin-code__intro{max-width:calc(var(--spacing, .25rem) * 80)}.axm-set-pin-code .axm-set-pin-code__otp{box-sizing:border-box}\n/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n"] }]
193
+ args: [{ selector: 'axm-set-pin-code', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CommonModule, FormsModule, AXFormModule, AXButtonModule, AXDecoratorModule, AXOtpModule, AXTranslationModule], template: "<ax-content>\n <div class=\"axm-set-pin-code__content flex flex-col items-center gap-4 p-6 text-center\">\n <div class=\"axm-set-pin-code__intro flex flex-col gap-2\">\n <h2 class=\"m-0 text-base font-semibold text-on-lightest\">\n @switch (step()) {\n @case ('verify-current') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.verify-current.title' | translate | async }}\n }\n @case ('enter') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.enter.title' | translate | async }}\n }\n @case ('confirm') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.confirm.title' | translate | async }}\n }\n }\n </h2>\n <p class=\"m-0 text-sm text-on-lighter-surface\">\n @switch (step()) {\n @case ('verify-current') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.verify-current.description' | translate | async }}\n }\n @case ('enter') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.enter.description' | translate | async }}\n }\n @case ('confirm') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.confirm.description' | translate | async }}\n }\n }\n </p>\n </div>\n\n <div class=\"axm-set-pin-code__otp w-full max-w-xs\">\n <ax-otp\n class=\"w-full block\"\n type=\"number\"\n [length]=\"pinLength\"\n [ngModel]=\"pinInput()\"\n (ngModelChange)=\"onPinInputChange($event)\"\n (onCompleted)=\"onPinCompleted($event)\"\n ></ax-otp>\n </div>\n </div>\n</ax-content>\n\n<ax-footer>\n <ax-suffix>\n @if (step() === 'confirm') {\n <ax-button\n look=\"solid\"\n color=\"default\"\n [text]=\"'@general:actions.back.title' | translate | async\"\n [disabled]=\"isSaving()\"\n (onClick)=\"onBack()\"\n ></ax-button>\n }\n\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"\n (step() === 'confirm'\n ? '@auth:profile-page.commands.set-pin-code.actions.save'\n : '@general:actions.next.title'\n )\n | translate\n | async\n \"\n [disabled]=\"!canProceed() || isSaving()\"\n (onClick)=\"onNext()\"\n ></ax-button>\n </ax-suffix>\n</ax-footer>\n", styles: [".axm-set-pin-code .axm-set-pin-code__content{box-sizing:border-box}.axm-set-pin-code .axm-set-pin-code__intro{max-width:calc(var(--spacing, .25rem) * 80)}.axm-set-pin-code .axm-set-pin-code__otp{box-sizing:border-box}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
185
194
  }], ctorParameters: () => [], propDecorators: { otpInput: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AXOtpComponent), { isSignal: true }] }] } });
186
195
 
187
196
  export { AXMSetPinCodeComponent };
188
- //# sourceMappingURL=acorex-platform-module-auth-client-set-pin-code.component-BHVqbYFv.mjs.map
197
+ //# sourceMappingURL=acorex-platform-module-auth-client-set-pin-code.component-Cq4skm_3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-auth-client-set-pin-code.component-Cq4skm_3.mjs","sources":["../../../../libs/modules/auth/client/src/lib/pages/account/set-pin-code/set-pin-code.component.ts","../../../../libs/modules/auth/client/src/lib/pages/account/set-pin-code/set-pin-code.component.html"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXFormModule } from '@acorex/components/form';\nimport { AXOtpCompletedEvent, AXOtpComponent, AXOtpModule } from '@acorex/components/otp';\nimport { AXBasePageComponent } from '@acorex/components/page';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationModule, 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 { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { defaultTo, get, isEmpty, isNil } from 'lodash';\nimport { AXP_AUTH_PIN_CODE_LENGTH, AXP_AUTH_PIN_CODE_PATTERN } from '../../../shared/constants/pin-code.constants';\nimport { AXPIdleLockService } from '../../../shared/services/idle-lock.service';\n\n//#region ---- Types ----\n\ntype SetPinCodeStep = 'verify-current' | 'enter' | 'confirm';\n\n//#endregion\n\n@Component({\n selector: 'axm-set-pin-code',\n templateUrl: './set-pin-code.component.html',\n styleUrl: './set-pin-code.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CommonModule, FormsModule, AXFormModule, AXButtonModule, AXDecoratorModule, AXOtpModule, AXTranslationModule],\n})\nexport class AXMSetPinCodeComponent extends AXBasePageComponent {\n //#region ---- Constants ----\n\n protected readonly pinLength = AXP_AUTH_PIN_CODE_LENGTH;\n\n //#endregion\n\n //#region ---- State ----\n\n protected readonly step = signal<SetPinCodeStep>('enter');\n protected readonly pinInput = signal('');\n protected readonly draftPin = signal('');\n protected readonly hasExistingPin = signal(false);\n protected readonly isSaving = signal(false);\n protected readonly storedPinCode = signal('');\n\n private isAdvancing = false;\n\n protected readonly canProceed = computed(() => AXP_AUTH_PIN_CODE_PATTERN.test(this.pinInput()));\n\n //#endregion\n\n //#region ---- View children ----\n\n private readonly otpInput = viewChild(AXOtpComponent);\n\n //#endregion\n\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly idleLockService = inject(AXPIdleLockService);\n private readonly toastService = inject(AXToastService);\n private readonly translateService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Lifecycle ----\n\n constructor() {\n super();\n void this.loadExistingPinState();\n }\n\n //#endregion\n\n //#region ---- UI Handlers ----\n\n protected onPinInputChange(value: string): void {\n this.pinInput.set(defaultTo(value, ''));\n }\n\n protected onPinCompleted(event: AXOtpCompletedEvent): void {\n if (!event.isCompleted || this.isSaving() || this.isAdvancing) {\n return;\n }\n\n this.pinInput.set(defaultTo(event.value, ''));\n void this.onNext();\n }\n\n protected onBack(): void {\n this.draftPin.set('');\n this.goToStep('enter');\n }\n\n protected async onNext(): Promise<void> {\n if (this.isAdvancing || this.isSaving()) {\n return;\n }\n\n this.isAdvancing = true;\n\n try {\n const pin = this.pinInput();\n\n if (!AXP_AUTH_PIN_CODE_PATTERN.test(pin)) {\n await this.showError('@auth:profile-page.commands.set-pin-code.messages.invalid-pin');\n this.focusOtp();\n return;\n }\n\n const currentStep = this.step();\n\n if (currentStep === 'verify-current') {\n if (pin !== this.storedPinCode()) {\n await this.showError('@auth:profile-page.commands.set-pin-code.messages.incorrect-current');\n this.resetPinInput();\n return;\n }\n\n this.goToStep('enter');\n return;\n }\n\n if (currentStep === 'enter') {\n this.draftPin.set(pin);\n this.goToStep('confirm');\n return;\n }\n\n if (pin !== this.draftPin()) {\n await this.showError('@auth:profile-page.commands.set-pin-code.messages.mismatch');\n this.resetPinInput();\n return;\n }\n\n await this.savePin(pin);\n } finally {\n this.isAdvancing = false;\n }\n }\n\n //#endregion\n\n //#region ---- Private Methods ----\n\n private async loadExistingPinState(): Promise<void> {\n const userId = this.sessionService.user?.id;\n if (isNil(userId)) {\n return;\n }\n\n try {\n const user = await this.getUserData().byKey(userId);\n const pinCode = defaultTo(get(user, 'pinCode'), '');\n const hasPin = !isEmpty(pinCode);\n\n this.storedPinCode.set(pinCode);\n this.hasExistingPin.set(hasPin);\n this.step.set(hasPin ? 'verify-current' : 'enter');\n this.focusOtp();\n } catch (error) {\n console.error('Failed to load user PIN state', error);\n this.step.set('enter');\n this.focusOtp();\n }\n }\n\n private goToStep(step: SetPinCodeStep): void {\n this.step.set(step);\n this.resetPinInput();\n }\n\n private resetPinInput(): void {\n this.pinInput.set('');\n this.otpInput()?.reset();\n this.focusOtp();\n }\n\n private focusOtp(): void {\n queueMicrotask(() => {\n this.otpInput()?.focus();\n });\n }\n\n private async savePin(pin: string): Promise<void> {\n const userId = this.sessionService.user?.id;\n if (isNil(userId)) {\n await this.showError('@auth:profile-page.commands.set-pin-code.messages.not-signed-in');\n return;\n }\n\n this.isSaving.set(true);\n try {\n await this.getUserData().update(userId, {\n pinCode: pin,\n pinChangedAt: new Date().toISOString(),\n });\n\n const successTitle = await this.translateService.translateAsync(\n '@auth:profile-page.commands.set-pin-code.messages.success',\n );\n this.toastService.show({ color: 'success', title: successTitle });\n this.idleLockService.requestLockScreenOffer();\n this.close({ success: true });\n } catch (error) {\n console.error('Failed to save PIN code', error);\n await this.showError('@auth:profile-page.commands.set-pin-code.messages.save-failed');\n } finally {\n this.isSaving.set(false);\n }\n }\n\n private getUserData() {\n return this.entityService\n .withEntity(SecurityManagementRootConfig.module.name, SecurityManagementRootConfig.entities.users.name)\n .data<string, AXMSecurityManagementUsersEntityModel>();\n }\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","<ax-content>\n <div class=\"axm-set-pin-code__content flex flex-col items-center gap-4 p-6 text-center\">\n <div class=\"axm-set-pin-code__intro flex flex-col gap-2\">\n <h2 class=\"m-0 text-base font-semibold text-on-lightest\">\n @switch (step()) {\n @case ('verify-current') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.verify-current.title' | translate | async }}\n }\n @case ('enter') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.enter.title' | translate | async }}\n }\n @case ('confirm') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.confirm.title' | translate | async }}\n }\n }\n </h2>\n <p class=\"m-0 text-sm text-on-lighter-surface\">\n @switch (step()) {\n @case ('verify-current') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.verify-current.description' | translate | async }}\n }\n @case ('enter') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.enter.description' | translate | async }}\n }\n @case ('confirm') {\n {{ '@auth:profile-page.commands.set-pin-code.steps.confirm.description' | translate | async }}\n }\n }\n </p>\n </div>\n\n <div class=\"axm-set-pin-code__otp w-full max-w-xs\">\n <ax-otp\n class=\"w-full block\"\n type=\"number\"\n [length]=\"pinLength\"\n [ngModel]=\"pinInput()\"\n (ngModelChange)=\"onPinInputChange($event)\"\n (onCompleted)=\"onPinCompleted($event)\"\n ></ax-otp>\n </div>\n </div>\n</ax-content>\n\n<ax-footer>\n <ax-suffix>\n @if (step() === 'confirm') {\n <ax-button\n look=\"solid\"\n color=\"default\"\n [text]=\"'@general:actions.back.title' | translate | async\"\n [disabled]=\"isSaving()\"\n (onClick)=\"onBack()\"\n ></ax-button>\n }\n\n <ax-button\n look=\"solid\"\n color=\"primary\"\n [text]=\"\n (step() === 'confirm'\n ? '@auth:profile-page.commands.set-pin-code.actions.save'\n : '@general:actions.next.title'\n )\n | translate\n | async\n \"\n [disabled]=\"!canProceed() || isSaving()\"\n (onClick)=\"onNext()\"\n ></ax-button>\n </ax-suffix>\n</ax-footer>\n"],"names":["SecurityManagementRootConfig","i2","i5","i6"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8BA;AAUM,MAAO,sBAAuB,SAAQ,mBAAmB,CAAA;;;AAwC7D,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;QAtCU,IAAA,CAAA,SAAS,GAAG,wBAAwB;;;QAMpC,IAAA,CAAA,IAAI,GAAG,MAAM,CAAiB,OAAO;iFAAC;QACtC,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,EAAE;qFAAC;QACrB,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,EAAE;qFAAC;QACrB,IAAA,CAA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AiB,CAAC,IAAI,EAAA,OAAA,EAC5B,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,mBAAmB,CAAC,EAAA,QAAA,EAAA,i2EAAA,EAAA,MAAA,EAAA,CAAA,gSAAA,CAAA,EAAA;oHA0BjF,cAAc,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
@@ -1,12 +1,123 @@
1
1
  import { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
2
- import { AXPAuthSettings, AXPAuthInactiveSessionTerminationOptions } from '@acorex-platform/module-auth-client/contracts';
2
+ import { AXP_AUTH_SIGN_IN_PAGE_SLOGAN_DEFAULT, AXPAuthSettings, AXP_AUTH_SIGN_IN_PAGE_DESCRIPTION_DEFAULT, AXPAuthCredentialTypeOptions, AXP_AUTH_LOCKOUT_SETTING_DEFAULTS, AXPAuthInactiveSessionTerminationOptions } from '@acorex-platform/module-auth-client/contracts';
3
3
 
4
4
  const I18N = '@auth:settings';
5
5
  class AXMSettingProvider {
6
6
  async provide(context) {
7
7
  context
8
8
  .addGroup('security-settings', `${I18N}.nav-title`, `${I18N}.description`, 'fa-light fa-lock', `${I18N}.title`, 95)
9
- // Authentication Section - Tenant Level
9
+ //#region ----- Sign-in page (P) -----
10
+ .addSection('sign-in-page', `${I18N}.sign-in-page.title`, `${I18N}.sign-in-page.description`)
11
+ .addSetting({
12
+ key: AXPAuthSettings.SignInPageSlogan,
13
+ title: `${I18N}.sign-in-page.slogan.title`,
14
+ scope: 'P',
15
+ overridableAt: [],
16
+ isInherited: false,
17
+ defaultValue: AXP_AUTH_SIGN_IN_PAGE_SLOGAN_DEFAULT,
18
+ widget: {
19
+ type: AXPWidgetsCatalog.text,
20
+ options: { multiLanguage: true },
21
+ },
22
+ description: `${I18N}.sign-in-page.slogan.description`,
23
+ })
24
+ .addSetting({
25
+ key: AXPAuthSettings.SignInPageDescription,
26
+ title: `${I18N}.sign-in-page.body.title`,
27
+ scope: 'P',
28
+ overridableAt: [],
29
+ isInherited: false,
30
+ defaultValue: AXP_AUTH_SIGN_IN_PAGE_DESCRIPTION_DEFAULT,
31
+ widget: {
32
+ type: AXPWidgetsCatalog.largeText,
33
+ options: { multiLanguage: true },
34
+ },
35
+ description: `${I18N}.sign-in-page.body.description`,
36
+ })
37
+ .endSection()
38
+ //#endregion
39
+ //#region ----- Sign-up (P) -----
40
+ .addSection('sign-up', `${I18N}.sign-up.title`, `${I18N}.sign-up.description`)
41
+ .addSetting({
42
+ key: AXPAuthSettings.SignUpEnabled,
43
+ title: `${I18N}.sign-up.enabled.title`,
44
+ scope: 'P',
45
+ overridableAt: [],
46
+ isInherited: false,
47
+ defaultValue: true,
48
+ widget: {
49
+ type: AXPWidgetsCatalog.toggle,
50
+ },
51
+ description: `${I18N}.sign-up.enabled.description`,
52
+ })
53
+ .addSetting({
54
+ key: AXPAuthSettings.SignUpUrl,
55
+ title: `${I18N}.sign-up.url.title`,
56
+ scope: 'P',
57
+ overridableAt: [],
58
+ isInherited: false,
59
+ defaultValue: '/auth/register',
60
+ widget: {
61
+ type: AXPWidgetsCatalog.text,
62
+ options: {
63
+ visibility: `{{ context.eval('${AXPAuthSettings.SignUpEnabled}') }}`,
64
+ },
65
+ },
66
+ description: `${I18N}.sign-up.url.description`,
67
+ })
68
+ .endSection()
69
+ //#endregion
70
+ //#region ----- Sign-in (P) -----
71
+ .addSection('sign-in', `${I18N}.sign-in.title`, `${I18N}.sign-in.description`)
72
+ .addSetting({
73
+ key: AXPAuthSettings.SignInCredentialType,
74
+ title: `${I18N}.sign-in.credential-type.title`,
75
+ scope: 'P',
76
+ overridableAt: [],
77
+ isInherited: false,
78
+ defaultValue: AXPAuthCredentialTypeOptions.UsernameEmailPassword,
79
+ widget: {
80
+ type: AXPWidgetsCatalog.select,
81
+ options: {
82
+ valueField: 'value',
83
+ textField: 'text',
84
+ dataSource: [
85
+ {
86
+ text: `${I18N}.sign-in.credential-type.options.username-password`,
87
+ value: AXPAuthCredentialTypeOptions.UsernamePassword,
88
+ },
89
+ {
90
+ text: `${I18N}.sign-in.credential-type.options.username-email-password`,
91
+ value: AXPAuthCredentialTypeOptions.UsernameEmailPassword,
92
+ },
93
+ {
94
+ text: `${I18N}.sign-in.credential-type.options.email-password`,
95
+ value: AXPAuthCredentialTypeOptions.EmailPassword,
96
+ },
97
+ {
98
+ text: `${I18N}.sign-in.credential-type.options.mobile-password`,
99
+ value: AXPAuthCredentialTypeOptions.MobilePassword,
100
+ },
101
+ ],
102
+ },
103
+ },
104
+ description: `${I18N}.sign-in.credential-type.description`,
105
+ })
106
+ .addSetting({
107
+ key: AXPAuthSettings.SignInDefaultStrategy,
108
+ title: `${I18N}.sign-in.default-strategy.title`,
109
+ scope: 'P',
110
+ overridableAt: [],
111
+ isInherited: false,
112
+ defaultValue: 'user-pass',
113
+ widget: {
114
+ type: AXPWidgetsCatalog.text,
115
+ },
116
+ description: `${I18N}.sign-in.default-strategy.description`,
117
+ })
118
+ .endSection()
119
+ //#endregion
120
+ // Authentication — tenant password policy; platform lockout thresholds
10
121
  .addSection('authentication', `${I18N}.authentication.title`, `${I18N}.authentication.description`)
11
122
  .addSetting({
12
123
  key: AXPAuthSettings.TwoFactorAuth,
@@ -70,10 +181,10 @@ class AXMSettingProvider {
70
181
  .addSetting({
71
182
  key: AXPAuthSettings.MaxLoginAttempts,
72
183
  title: `${I18N}.authentication.max-attempts.title`,
73
- scope: 'T',
184
+ scope: 'P',
74
185
  overridableAt: [],
75
- isInherited: true,
76
- defaultValue: 5,
186
+ isInherited: false,
187
+ defaultValue: AXP_AUTH_LOCKOUT_SETTING_DEFAULTS[AXPAuthSettings.MaxLoginAttempts],
77
188
  widget: {
78
189
  type: AXPWidgetsCatalog.number,
79
190
  options: {
@@ -87,19 +198,36 @@ class AXMSettingProvider {
87
198
  .addSetting({
88
199
  key: AXPAuthSettings.LockoutDuration,
89
200
  title: `${I18N}.authentication.lockout.title`,
90
- scope: 'T',
201
+ scope: 'P',
91
202
  overridableAt: [],
92
- isInherited: true,
93
- defaultValue: 15,
203
+ isInherited: false,
204
+ defaultValue: AXP_AUTH_LOCKOUT_SETTING_DEFAULTS[AXPAuthSettings.LockoutDuration],
94
205
  widget: {
95
206
  type: AXPWidgetsCatalog.number,
96
207
  options: {
97
- minValue: 5,
208
+ minValue: 1,
98
209
  maxValue: 60,
99
- step: 5,
210
+ step: 1,
100
211
  },
101
212
  },
102
213
  description: `${I18N}.authentication.lockout.description`,
214
+ })
215
+ .addSetting({
216
+ key: AXPAuthSettings.CaptchaAttemptThreshold,
217
+ title: `${I18N}.authentication.captcha-threshold.title`,
218
+ scope: 'P',
219
+ overridableAt: [],
220
+ isInherited: false,
221
+ defaultValue: AXP_AUTH_LOCKOUT_SETTING_DEFAULTS[AXPAuthSettings.CaptchaAttemptThreshold],
222
+ widget: {
223
+ type: AXPWidgetsCatalog.number,
224
+ options: {
225
+ minValue: 1,
226
+ maxValue: 10,
227
+ step: 1,
228
+ },
229
+ },
230
+ description: `${I18N}.authentication.captcha-threshold.description`,
103
231
  })
104
232
  .endSection()
105
233
  // Auto-Lock — idle lock screen + terminate old sessions
@@ -174,4 +302,4 @@ class AXMSettingProvider {
174
302
  }
175
303
 
176
304
  export { AXMSettingProvider };
177
- //# sourceMappingURL=acorex-platform-module-auth-client-settings.provider-n1qbs6e1.mjs.map
305
+ //# sourceMappingURL=acorex-platform-module-auth-client-settings.provider-Yaoz8yp3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-auth-client-settings.provider-Yaoz8yp3.mjs","sources":["../../../../libs/modules/auth/client/src/lib/settings.provider.ts"],"sourcesContent":["import {\n AXPSettingDefinitionProvider,\n AXPSettingDefinitionProviderContext,\n} from '@acorex-platform/framework-client/common';\nimport { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';\nimport {\n AXPAuthCredentialTypeOptions,\n AXPAuthInactiveSessionTerminationOptions,\n AXPAuthSettings,\n AXP_AUTH_LOCKOUT_SETTING_DEFAULTS,\n AXP_AUTH_SIGN_IN_PAGE_DESCRIPTION_DEFAULT,\n AXP_AUTH_SIGN_IN_PAGE_SLOGAN_DEFAULT,\n} from '@acorex-platform/module-auth-client/contracts';\n\nconst I18N = '@auth:settings';\n\nexport class AXMSettingProvider implements AXPSettingDefinitionProvider {\n async provide(context: AXPSettingDefinitionProviderContext): Promise<void> {\n context\n .addGroup(\n 'security-settings',\n `${I18N}.nav-title`,\n `${I18N}.description`,\n 'fa-light fa-lock',\n `${I18N}.title`,\n 95,\n )\n\n //#region ----- Sign-in page (P) -----\n .addSection('sign-in-page', `${I18N}.sign-in-page.title`, `${I18N}.sign-in-page.description`)\n .addSetting({\n key: AXPAuthSettings.SignInPageSlogan,\n title: `${I18N}.sign-in-page.slogan.title`,\n scope: 'P',\n overridableAt: [],\n isInherited: false,\n defaultValue: AXP_AUTH_SIGN_IN_PAGE_SLOGAN_DEFAULT,\n widget: {\n type: AXPWidgetsCatalog.text,\n options: { multiLanguage: true },\n },\n description: `${I18N}.sign-in-page.slogan.description`,\n })\n .addSetting({\n key: AXPAuthSettings.SignInPageDescription,\n title: `${I18N}.sign-in-page.body.title`,\n scope: 'P',\n overridableAt: [],\n isInherited: false,\n defaultValue: AXP_AUTH_SIGN_IN_PAGE_DESCRIPTION_DEFAULT,\n widget: {\n type: AXPWidgetsCatalog.largeText,\n options: { multiLanguage: true },\n },\n description: `${I18N}.sign-in-page.body.description`,\n })\n .endSection()\n //#endregion\n\n //#region ----- Sign-up (P) -----\n .addSection('sign-up', `${I18N}.sign-up.title`, `${I18N}.sign-up.description`)\n .addSetting({\n key: AXPAuthSettings.SignUpEnabled,\n title: `${I18N}.sign-up.enabled.title`,\n scope: 'P',\n overridableAt: [],\n isInherited: false,\n defaultValue: true,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n },\n description: `${I18N}.sign-up.enabled.description`,\n })\n .addSetting({\n key: AXPAuthSettings.SignUpUrl,\n title: `${I18N}.sign-up.url.title`,\n scope: 'P',\n overridableAt: [],\n isInherited: false,\n defaultValue: '/auth/register',\n widget: {\n type: AXPWidgetsCatalog.text,\n options: {\n visibility: `{{ context.eval('${AXPAuthSettings.SignUpEnabled}') }}`,\n },\n },\n description: `${I18N}.sign-up.url.description`,\n })\n .endSection()\n //#endregion\n\n //#region ----- Sign-in (P) -----\n .addSection('sign-in', `${I18N}.sign-in.title`, `${I18N}.sign-in.description`)\n .addSetting({\n key: AXPAuthSettings.SignInCredentialType,\n title: `${I18N}.sign-in.credential-type.title`,\n scope: 'P',\n overridableAt: [],\n isInherited: false,\n defaultValue: AXPAuthCredentialTypeOptions.UsernameEmailPassword,\n widget: {\n type: AXPWidgetsCatalog.select,\n options: {\n valueField: 'value',\n textField: 'text',\n dataSource: [\n {\n text: `${I18N}.sign-in.credential-type.options.username-password`,\n value: AXPAuthCredentialTypeOptions.UsernamePassword,\n },\n {\n text: `${I18N}.sign-in.credential-type.options.username-email-password`,\n value: AXPAuthCredentialTypeOptions.UsernameEmailPassword,\n },\n {\n text: `${I18N}.sign-in.credential-type.options.email-password`,\n value: AXPAuthCredentialTypeOptions.EmailPassword,\n },\n {\n text: `${I18N}.sign-in.credential-type.options.mobile-password`,\n value: AXPAuthCredentialTypeOptions.MobilePassword,\n },\n ],\n },\n },\n description: `${I18N}.sign-in.credential-type.description`,\n })\n .addSetting({\n key: AXPAuthSettings.SignInDefaultStrategy,\n title: `${I18N}.sign-in.default-strategy.title`,\n scope: 'P',\n overridableAt: [],\n isInherited: false,\n defaultValue: 'user-pass',\n widget: {\n type: AXPWidgetsCatalog.text,\n },\n description: `${I18N}.sign-in.default-strategy.description`,\n })\n .endSection()\n //#endregion\n\n // Authentication — tenant password policy; platform lockout thresholds\n .addSection('authentication', `${I18N}.authentication.title`, `${I18N}.authentication.description`)\n .addSetting({\n key: AXPAuthSettings.TwoFactorAuth,\n title: `${I18N}.authentication.two-factor.title`,\n scope: 'T',\n overridableAt: [],\n isInherited: true,\n defaultValue: false,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n },\n description: `${I18N}.authentication.two-factor.description`,\n })\n .addSetting({\n key: AXPAuthSettings.PasswordComplexity,\n title: `${I18N}.authentication.password.title`,\n scope: 'T',\n overridableAt: [],\n isInherited: true,\n defaultValue: 'Medium',\n widget: {\n type: AXPWidgetsCatalog.select,\n options: {\n valueField: 'value',\n textField: 'text',\n dataSource: [\n {\n text: `${I18N}.authentication.password.options.low`,\n value: 'Low',\n },\n {\n text: `${I18N}.authentication.password.options.medium`,\n value: 'Medium',\n },\n {\n text: `${I18N}.authentication.password.options.high`,\n value: 'High',\n },\n ],\n },\n },\n description: `${I18N}.authentication.password.description`,\n })\n .addSetting({\n key: AXPAuthSettings.PasswordExpiryDays,\n title: `${I18N}.authentication.password-expiry.title`,\n scope: 'T',\n overridableAt: [],\n isInherited: true,\n defaultValue: 90,\n widget: {\n type: AXPWidgetsCatalog.number,\n options: {\n minValue: 30,\n maxValue: 365,\n step: 1,\n },\n },\n description: `${I18N}.authentication.password-expiry.description`,\n })\n .addSetting({\n key: AXPAuthSettings.MaxLoginAttempts,\n title: `${I18N}.authentication.max-attempts.title`,\n scope: 'P',\n overridableAt: [],\n isInherited: false,\n defaultValue: AXP_AUTH_LOCKOUT_SETTING_DEFAULTS[AXPAuthSettings.MaxLoginAttempts],\n widget: {\n type: AXPWidgetsCatalog.number,\n options: {\n minValue: 3,\n maxValue: 10,\n step: 1,\n },\n },\n description: `${I18N}.authentication.max-attempts.description`,\n })\n .addSetting({\n key: AXPAuthSettings.LockoutDuration,\n title: `${I18N}.authentication.lockout.title`,\n scope: 'P',\n overridableAt: [],\n isInherited: false,\n defaultValue: AXP_AUTH_LOCKOUT_SETTING_DEFAULTS[AXPAuthSettings.LockoutDuration],\n widget: {\n type: AXPWidgetsCatalog.number,\n options: {\n minValue: 1,\n maxValue: 60,\n step: 1,\n },\n },\n description: `${I18N}.authentication.lockout.description`,\n })\n .addSetting({\n key: AXPAuthSettings.CaptchaAttemptThreshold,\n title: `${I18N}.authentication.captcha-threshold.title`,\n scope: 'P',\n overridableAt: [],\n isInherited: false,\n defaultValue: AXP_AUTH_LOCKOUT_SETTING_DEFAULTS[AXPAuthSettings.CaptchaAttemptThreshold],\n widget: {\n type: AXPWidgetsCatalog.number,\n options: {\n minValue: 1,\n maxValue: 10,\n step: 1,\n },\n },\n description: `${I18N}.authentication.captcha-threshold.description`,\n })\n .endSection()\n\n // Auto-Lock — idle lock screen + terminate old sessions\n .addSection('session-management', `${I18N}.session.title`, `${I18N}.session.description`)\n .addSetting({\n key: AXPAuthSettings.LockWhenIdleEnabled,\n title: `${I18N}.session.lock-when-idle.title`,\n scope: 'U',\n overridableAt: [],\n isInherited: true,\n defaultValue: true,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n },\n description: `${I18N}.session.lock-when-idle.description`,\n })\n .addSetting({\n key: AXPAuthSettings.LockWhenIdleMinutes,\n title: `${I18N}.session.lock-when-idle-minutes.title`,\n scope: 'U',\n overridableAt: [],\n isInherited: true,\n defaultValue: 15,\n widget: {\n type: AXPWidgetsCatalog.number,\n options: {\n minValue: 1,\n maxValue: 60,\n step: 1,\n visibility: `{{ context.eval('${AXPAuthSettings.LockWhenIdleEnabled}') }}`,\n },\n },\n description: `${I18N}.session.lock-when-idle-minutes.description`,\n })\n .addSetting({\n key: AXPAuthSettings.InactiveSessionTermination,\n title: `${I18N}.session.terminate-old-sessions.title`,\n description: `${I18N}.session.terminate-old-sessions.description`,\n scope: 'U',\n overridableAt: [],\n isInherited: false,\n defaultValue: AXPAuthInactiveSessionTerminationOptions.OneMonth,\n widget: {\n type: AXPWidgetsCatalog.select,\n options: {\n valueField: 'id',\n textField: 'title',\n dataSource: [\n {\n id: AXPAuthInactiveSessionTerminationOptions.OneWeek,\n title: `${I18N}.session.terminate-old-sessions.options.one-week`,\n },\n {\n id: AXPAuthInactiveSessionTerminationOptions.OneMonth,\n title: `${I18N}.session.terminate-old-sessions.options.one-month`,\n },\n {\n id: AXPAuthInactiveSessionTerminationOptions.ThreeMonths,\n title: `${I18N}.session.terminate-old-sessions.options.three-months`,\n },\n {\n id: AXPAuthInactiveSessionTerminationOptions.SixMonths,\n title: `${I18N}.session.terminate-old-sessions.options.six-months`,\n },\n ],\n },\n },\n })\n .endSection()\n .endGroup();\n }\n}\n"],"names":[],"mappings":";;;AAcA,MAAM,IAAI,GAAG,gBAAgB;MAEhB,kBAAkB,CAAA;IAC7B,MAAM,OAAO,CAAC,OAA4C,EAAA;QACxD;AACG,aAAA,QAAQ,CACP,mBAAmB,EACnB,GAAG,IAAI,CAAA,UAAA,CAAY,EACnB,CAAA,EAAG,IAAI,CAAA,YAAA,CAAc,EACrB,kBAAkB,EAClB,CAAA,EAAG,IAAI,CAAA,MAAA,CAAQ,EACf,EAAE;;aAIH,UAAU,CAAC,cAAc,EAAE,CAAA,EAAG,IAAI,qBAAqB,EAAE,CAAA,EAAG,IAAI,CAAA,yBAAA,CAA2B;AAC3F,aAAA,UAAU,CAAC;YACV,GAAG,EAAE,eAAe,CAAC,gBAAgB;YACrC,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,0BAAA,CAA4B;AAC1C,YAAA,KAAK,EAAE,GAAG;AACV,YAAA,aAAa,EAAE,EAAE;AACjB,YAAA,WAAW,EAAE,KAAK;AAClB,YAAA,YAAY,EAAE,oCAAoC;AAClD,YAAA,MAAM,EAAE;gBACN,IAAI,EAAE,iBAAiB,CAAC,IAAI;AAC5B,gBAAA,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE;AACjC,aAAA;YACD,WAAW,EAAE,CAAA,EAAG,IAAI,CAAA,gCAAA,CAAkC;SACvD;AACA,aAAA,UAAU,CAAC;YACV,GAAG,EAAE,eAAe,CAAC,qBAAqB;YAC1C,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,wBAAA,CAA0B;AACxC,YAAA,KAAK,EAAE,GAAG;AACV,YAAA,aAAa,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AE,CAAA,EAAG,IAAI,CAAA,qCAAA,CAAuC;YACrD,WAAW,EAAE,CAAA,EAAG,IAAI,CAAA,2CAAA,CAA6C;AACjE,YAAA,KAAK,EAAE,GAAG;AACV,YAAA,aAAa,EAAE,EAAE;AACjB,YAAA,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,wCAAwC,CAAC,QAAQ;AAC/D,YAAA,MAAM,EAAE;gBACN,IAAI,EAAE,iBAAiB,CAAC,MAAM;AAC9B,gBAAA,OAAO,EAAE;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,SAAS,EAAE,OAAO;AAClB,oBAAA,UAAU,EAAE;AACV,wBAAA;4BACE,EAAE,EAAE,wCAAwC,CAAC,OAAO;4BACpD,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,gDAAA,CAAkD;AACjE,yBAAA;AACD,wBAAA;4BACE,EAAE,EAAE,wCAAwC,CAAC,QAAQ;4BACrD,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,iDAAA,CAAmD;AAClE,yBAAA;AACD,wBAAA;4BACE,EAAE,EAAE,wCAAwC,CAAC,WAAW;4BACxD,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,oDAAA,CAAsD;AACrE,yBAAA;AACD,wBAAA;4BACE,EAAE,EAAE,wCAAwC,CAAC,SAAS;4BACtD,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,kDAAA,CAAoD;AACnE,yBAAA;AACF,qBAAA;AACF,iBAAA;AACF,aAAA;SACF;AACA,aAAA,UAAU;AACV,aAAA,QAAQ,EAAE;IACf;AACD;;;;"}
@@ -30,8 +30,7 @@ class AXPShowProfileCommand {
30
30
  const employeeId = result.items[0]?.id;
31
31
  if (employeeId) {
32
32
  this.router.navigate([`/${application?.name}/m/HumanCapitalManagement/e/Employee`, employeeId, 'view']);
33
- return {
34
- success: true,
33
+ return { success: true, kind: 'object',
35
34
  data: {
36
35
  employeeId,
37
36
  },
@@ -56,10 +55,10 @@ class AXPShowProfileCommand {
56
55
  };
57
56
  }
58
57
  }
59
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPShowProfileCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
60
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPShowProfileCommand, providedIn: 'root' }); }
58
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPShowProfileCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
59
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPShowProfileCommand, providedIn: 'root' }); }
61
60
  }
62
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPShowProfileCommand, decorators: [{
61
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPShowProfileCommand, decorators: [{
63
62
  type: Injectable,
64
63
  args: [{
65
64
  providedIn: 'root',
@@ -67,4 +66,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
67
66
  }] });
68
67
 
69
68
  export { AXPShowProfileCommand };
70
- //# sourceMappingURL=acorex-platform-module-auth-client-show-profile-command-CxMz1yy-.mjs.map
69
+ //# sourceMappingURL=acorex-platform-module-auth-client-show-profile-command-BWoDxIdx.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-auth-client-show-profile-command-BWoDxIdx.mjs","sources":["../../../../libs/modules/auth/client/src/lib/commands/show-profile-command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { inject, Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXPShowProfileCommand implements AXPCommand {\n private readonly entityService = inject(AXPEntityDefinitionRegistryService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly router = inject(Router);\n\n async execute(input: any): AXPCommandExecuteResultPromise<any> {\n try {\n const user = this.sessionService.user;\n const application = this.sessionService.application;\n const entity = await this.entityService.resolve('HumanCapitalManagement', 'Employee');\n const listQuery = entity.queries?.list?.execute as Function;\n const result = await listQuery({\n filter: {\n field: 'userId',\n operator: {\n type: 'equal',\n },\n value: user?.id,\n },\n take: 1,\n skip: 0,\n });\n const employeeId = result.items[0]?.id;\n if (employeeId) {\n this.router.navigate([`/${application?.name}/m/HumanCapitalManagement/e/Employee`, employeeId, 'view']);\n return { success: true, kind: 'object',\n data: {\n employeeId,\n },\n };\n } else {\n return {\n success: false,\n message: {\n text: 'Employee not found',\n },\n };\n }\n } catch (error) {\n console.error(error);\n return {\n success: false,\n message: {\n text: error instanceof Error ? error.message : 'Failed to open profile',\n },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;;;MAYa,qBAAqB,CAAA;AAHlC,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,kCAAkC,CAAC;AAC1D,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AA6CzC,IAAA;IA3CC,MAAM,OAAO,CAAC,KAAU,EAAA;AACtB,QAAA,IAAI;AACF,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI;AACrC,YAAA,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW;AACnD,YAAA,MAAM,MAAM,GAAG,M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AAA,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,cAFpB,MAAM,EAAA,CAAA,CAAA;;2FAEP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -8,12 +8,12 @@ class AXPSignoutCommand {
8
8
  }
9
9
  async execute() {
10
10
  await this.sessionService.signout();
11
- return { success: true };
11
+ return { success: true, kind: 'object', data: undefined };
12
12
  }
13
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSignoutCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
14
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSignoutCommand, providedIn: 'root' }); }
13
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPSignoutCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
14
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPSignoutCommand, providedIn: 'root' }); }
15
15
  }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPSignoutCommand, decorators: [{
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPSignoutCommand, decorators: [{
17
17
  type: Injectable,
18
18
  args: [{
19
19
  providedIn: 'root',
@@ -21,4 +21,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
21
21
  }] });
22
22
 
23
23
  export { AXPSignoutCommand };
24
- //# sourceMappingURL=acorex-platform-module-auth-client-signout-command-DqqrP5pk.mjs.map
24
+ //# sourceMappingURL=acorex-platform-module-auth-client-signout-command-B7n_Fn4P.mjs.map