@acorex/modules 20.7.7 → 20.7.8

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 (31) hide show
  1. package/auth/index.d.ts +16 -2
  2. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-CyabqFR8.mjs → acorex-modules-auth-acorex-modules-auth-Dg9sg98-.mjs} +32 -13
  3. package/fesm2022/acorex-modules-auth-acorex-modules-auth-Dg9sg98-.mjs.map +1 -0
  4. package/fesm2022/{acorex-modules-auth-app-chooser.component-CizgE3Bb.mjs → acorex-modules-auth-app-chooser.component-Dr8EZ7ZX.mjs} +2 -2
  5. package/fesm2022/{acorex-modules-auth-app-chooser.component-CizgE3Bb.mjs.map → acorex-modules-auth-app-chooser.component-Dr8EZ7ZX.mjs.map} +1 -1
  6. package/fesm2022/{acorex-modules-auth-login.module-DRVqUojm.mjs → acorex-modules-auth-login.module-C7Rt6tLk.mjs} +6 -4
  7. package/fesm2022/acorex-modules-auth-login.module-C7Rt6tLk.mjs.map +1 -0
  8. package/fesm2022/{acorex-modules-auth-master.layout-C1zCbrQh.mjs → acorex-modules-auth-master.layout-CgD5kk65.mjs} +2 -2
  9. package/fesm2022/{acorex-modules-auth-master.layout-C1zCbrQh.mjs.map → acorex-modules-auth-master.layout-CgD5kk65.mjs.map} +1 -1
  10. package/fesm2022/{acorex-modules-auth-oauth-callback.component-DmNV6zL4.mjs → acorex-modules-auth-oauth-callback.component-CuGIGBVO.mjs} +2 -2
  11. package/fesm2022/{acorex-modules-auth-oauth-callback.component-DmNV6zL4.mjs.map → acorex-modules-auth-oauth-callback.component-CuGIGBVO.mjs.map} +1 -1
  12. package/fesm2022/{acorex-modules-auth-password.component-BmTCzp3t.mjs → acorex-modules-auth-password.component-C6TCAUm4.mjs} +2 -2
  13. package/fesm2022/{acorex-modules-auth-password.component-BmTCzp3t.mjs.map → acorex-modules-auth-password.component-C6TCAUm4.mjs.map} +1 -1
  14. package/fesm2022/{acorex-modules-auth-password.component-DSysOOu9.mjs → acorex-modules-auth-password.component-DmohsIxt.mjs} +2 -2
  15. package/fesm2022/{acorex-modules-auth-password.component-DSysOOu9.mjs.map → acorex-modules-auth-password.component-DmohsIxt.mjs.map} +1 -1
  16. package/fesm2022/{acorex-modules-auth-routes-oYfOJjLO.mjs → acorex-modules-auth-routes-C3162bwa.mjs} +2 -2
  17. package/fesm2022/{acorex-modules-auth-routes-oYfOJjLO.mjs.map → acorex-modules-auth-routes-C3162bwa.mjs.map} +1 -1
  18. package/fesm2022/{acorex-modules-auth-tenant-chooser.component-DqrZiwp6.mjs → acorex-modules-auth-tenant-chooser.component-Ce-n3WC9.mjs} +2 -2
  19. package/fesm2022/{acorex-modules-auth-tenant-chooser.component-DqrZiwp6.mjs.map → acorex-modules-auth-tenant-chooser.component-Ce-n3WC9.mjs.map} +1 -1
  20. package/fesm2022/{acorex-modules-auth-two-factor.module-Cc3x-76V.mjs → acorex-modules-auth-two-factor.module-B2nPzX-3.mjs} +2 -2
  21. package/fesm2022/{acorex-modules-auth-two-factor.module-Cc3x-76V.mjs.map → acorex-modules-auth-two-factor.module-B2nPzX-3.mjs.map} +1 -1
  22. package/fesm2022/{acorex-modules-auth-user-sessions.component-CiGEYKgb.mjs → acorex-modules-auth-user-sessions.component-wVKJ2KIm.mjs} +2 -2
  23. package/fesm2022/{acorex-modules-auth-user-sessions.component-CiGEYKgb.mjs.map → acorex-modules-auth-user-sessions.component-wVKJ2KIm.mjs.map} +1 -1
  24. package/fesm2022/acorex-modules-auth.mjs +1 -1
  25. package/fesm2022/{acorex-modules-person-management-person.entity-BtaGNj8n.mjs → acorex-modules-person-management-person.entity-CaEVw1mL.mjs} +2 -2
  26. package/fesm2022/acorex-modules-person-management-person.entity-CaEVw1mL.mjs.map +1 -0
  27. package/fesm2022/acorex-modules-person-management.mjs +1 -1
  28. package/package.json +6 -6
  29. package/fesm2022/acorex-modules-auth-acorex-modules-auth-CyabqFR8.mjs.map +0 -1
  30. package/fesm2022/acorex-modules-auth-login.module-DRVqUojm.mjs.map +0 -1
  31. package/fesm2022/acorex-modules-person-management-person.entity-BtaGNj8n.mjs.map +0 -1
package/auth/index.d.ts CHANGED
@@ -3,8 +3,9 @@ import { AXPErrorHandler } from '@acorex/platform/common';
3
3
  import * as i0 from '@angular/core';
4
4
  import { InjectionToken } from '@angular/core';
5
5
  import { AuthConfig } from 'angular-oauth2-oidc';
6
- import * as i1$1 from '@angular/common';
7
6
  import * as i1 from '@angular/router';
7
+ import { CanActivateFn } from '@angular/router';
8
+ import * as i1$1 from '@angular/common';
8
9
  import * as i2 from '@acorex/platform/layout/components';
9
10
  import { AXPEntityModel, AXMEntityCrudServiceImpl } from '@acorex/platform/layout/entity';
10
11
  import { Observable } from 'rxjs';
@@ -53,6 +54,13 @@ interface AXMAuthConfigs {
53
54
  declare const AXMDefaultAuthConfigs: AXMAuthConfigs;
54
55
  declare function configAuthModule(config?: Partial<AXMAuthConfigs>): AXMAuthConfigs;
55
56
 
57
+ /**
58
+ * Injection token for login page guard.
59
+ * Apps can provide their own custom guard by providing this token.
60
+ * If not provided, the default guard (canActivateLogin) will be used.
61
+ */
62
+ declare const AXM_LOGIN_GUARD_TOKEN: InjectionToken<CanActivateFn>;
63
+
56
64
  declare class AXPAccountModule {
57
65
  static ɵfac: i0.ɵɵFactoryDeclaration<AXPAccountModule, never>;
58
66
  static ɵmod: i0.ɵɵNgModuleDeclaration<AXPAccountModule, never, [typeof i1.RouterModule, typeof i2.AXPComponentSlotModule], never>;
@@ -129,5 +137,11 @@ declare class AXMDeviceSessionsServiceImpl extends AXMDeviceSessionsService {
129
137
  static ɵprov: i0.ɵɵInjectableDeclaration<AXMDeviceSessionsServiceImpl>;
130
138
  }
131
139
 
132
- export { AXMAuthErrorHandler, AXMAuthModule, AXMAuthenticationTypes, AXMDefaultAuthConfigs, AXMDeviceSessionsService, AXMDeviceSessionsServiceImpl, AXMSessionStatusTypes, AXM_AUTH_CONFIG_TOKEN, AXPIdleService, configAuthModule };
140
+ /**
141
+ * Guard for login page that redirects authenticated users to home page.
142
+ * This guard prevents authenticated users from accessing the login page.
143
+ */
144
+ declare const canActivateLogin: CanActivateFn;
145
+
146
+ export { AXMAuthErrorHandler, AXMAuthModule, AXMAuthenticationTypes, AXMDefaultAuthConfigs, AXMDeviceSessionsService, AXMDeviceSessionsServiceImpl, AXMSessionStatusTypes, AXM_AUTH_CONFIG_TOKEN, AXM_LOGIN_GUARD_TOKEN, AXPIdleService, canActivateLogin, configAuthModule };
133
147
  export type { AXMAuthConfigs, AXMExternalProviderConfig, AXMSecurityManagementDeviceSessionsEntityModel };
@@ -77,6 +77,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
77
77
  type: Injectable
78
78
  }] });
79
79
 
80
+ /**
81
+ * Guard for login page that redirects authenticated users to home page.
82
+ * This guard prevents authenticated users from accessing the login page.
83
+ */
84
+ const canActivateLogin = async (route, state) => {
85
+ // If not authenticated, allow access to login page
86
+ return true;
87
+ };
88
+
80
89
  var AXMAuthenticationTypes;
81
90
  (function (AXMAuthenticationTypes) {
82
91
  AXMAuthenticationTypes[AXMAuthenticationTypes["UsernamePassword"] = 0] = "UsernamePassword";
@@ -96,11 +105,21 @@ const AXMDefaultAuthConfigs = {
96
105
  type: AXMAuthenticationTypes.UsernamePassword,
97
106
  // defaultStrategyName:'oidc',
98
107
  // حذف authConfig از اینجا چون از environment خوانده می‌شود
99
- defaultStrategyName: 'user-pass'
108
+ defaultStrategyName: 'user-pass',
100
109
  };
101
110
  function configAuthModule(config = AXMDefaultAuthConfigs) {
102
111
  return { ...AXMDefaultAuthConfigs, ...config };
103
112
  }
113
+ /**
114
+ * Injection token for login page guard.
115
+ * Apps can provide their own custom guard by providing this token.
116
+ * If not provided, the default guard (canActivateLogin) will be used.
117
+ */
118
+ const AXM_LOGIN_GUARD_TOKEN = new InjectionToken('AXM_LOGIN_GUARD_TOKEN', {
119
+ providedIn: 'root',
120
+ factory: () => canActivateLogin,
121
+ });
122
+ //#endregion
104
123
 
105
124
  const routes = [
106
125
  {
@@ -113,22 +132,22 @@ const routes = [
113
132
  },
114
133
  {
115
134
  path: '',
116
- loadComponent: () => import('./acorex-modules-auth-master.layout-C1zCbrQh.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
117
- loadChildren: () => import('./acorex-modules-auth-login.module-DRVqUojm.mjs').then((c) => c.AXPSignInModule),
135
+ loadComponent: () => import('./acorex-modules-auth-master.layout-CgD5kk65.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
136
+ loadChildren: () => import('./acorex-modules-auth-login.module-C7Rt6tLk.mjs').then((c) => c.AXPSignInModule),
118
137
  },
119
138
  {
120
139
  path: '',
121
- loadComponent: () => import('./acorex-modules-auth-master.layout-C1zCbrQh.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
122
- loadChildren: () => import('./acorex-modules-auth-two-factor.module-Cc3x-76V.mjs').then((c) => c.AXPTwoFactorModule),
140
+ loadComponent: () => import('./acorex-modules-auth-master.layout-CgD5kk65.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
141
+ loadChildren: () => import('./acorex-modules-auth-two-factor.module-B2nPzX-3.mjs').then((c) => c.AXPTwoFactorModule),
123
142
  },
124
143
  {
125
144
  path: '',
126
- loadComponent: () => import('./acorex-modules-auth-master.layout-C1zCbrQh.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
127
- loadChildren: () => import('./acorex-modules-auth-routes-oYfOJjLO.mjs').then((c) => c),
145
+ loadComponent: () => import('./acorex-modules-auth-master.layout-CgD5kk65.mjs').then((c) => c.AXPAuthMasterLayoutComponent),
146
+ loadChildren: () => import('./acorex-modules-auth-routes-C3162bwa.mjs').then((c) => c),
128
147
  },
129
148
  {
130
149
  path: 'axp-oauth-callback',
131
- loadComponent: () => import('./acorex-modules-auth-oauth-callback.component-DmNV6zL4.mjs').then((c) => c.AXPOAuthCallbackComponent),
150
+ loadComponent: () => import('./acorex-modules-auth-oauth-callback.component-CuGIGBVO.mjs').then((c) => c.AXPOAuthCallbackComponent),
132
151
  },
133
152
  {
134
153
  path: 'account',
@@ -325,7 +344,7 @@ class AXMAuthProfileSlotComponent {
325
344
  this.router.navigate(['/auth/login']);
326
345
  }
327
346
  async openUserSession() {
328
- const com = await import('./acorex-modules-auth-user-sessions.component-CiGEYKgb.mjs').then((c) => c.AXMUserSessionsComponent);
347
+ const com = await import('./acorex-modules-auth-user-sessions.component-wVKJ2KIm.mjs').then((c) => c.AXMUserSessionsComponent);
329
348
  this.popupService.open(com, {
330
349
  size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'sm',
331
350
  title: await this.translateService.translateAsync('@auth:profile.sessions.title'),
@@ -618,12 +637,12 @@ function routesFacory() {
618
637
  routes = [
619
638
  {
620
639
  path: 'tenant-chooser',
621
- loadComponent: () => import('./acorex-modules-auth-tenant-chooser.component-DqrZiwp6.mjs').then((c) => c.AXPAuthTenantChooserComponent),
640
+ loadComponent: () => import('./acorex-modules-auth-tenant-chooser.component-Ce-n3WC9.mjs').then((c) => c.AXPAuthTenantChooserComponent),
622
641
  canActivate: [AXPAuthGuard, canActivateTenantChooser],
623
642
  },
624
643
  {
625
644
  path: 'app-chooser',
626
- loadComponent: () => import('./acorex-modules-auth-app-chooser.component-CizgE3Bb.mjs').then((c) => c.AXPAuthAppChooserComponent),
645
+ loadComponent: () => import('./acorex-modules-auth-app-chooser.component-Dr8EZ7ZX.mjs').then((c) => c.AXPAuthAppChooserComponent),
627
646
  canActivate: [AXPAuthGuard, canActivateAppChooser],
628
647
  },
629
648
  ];
@@ -769,5 +788,5 @@ var AXMSessionStatusTypes;
769
788
  * Generated bundle index. Do not edit.
770
789
  */
771
790
 
772
- export { AXM_AUTH_CONFIG_TOKEN as A, AXMAuthenticationTypes as a, AXPTenantChooserListComponent as b, AXPTenantChooserDropdownComponent as c, AXPAppChooserListComponent as d, AXMUserDeviceSessionsService as e, AXMAuthErrorHandler as f, AXMDefaultAuthConfigs as g, configAuthModule as h, AXMAuthModule as i, AXMSessionStatusTypes as j, AXPIdleService as k, AXMDeviceSessionsService as l, AXMDeviceSessionsServiceImpl as m };
773
- //# sourceMappingURL=acorex-modules-auth-acorex-modules-auth-CyabqFR8.mjs.map
791
+ export { AXM_AUTH_CONFIG_TOKEN as A, AXM_LOGIN_GUARD_TOKEN as a, AXMAuthenticationTypes as b, AXPTenantChooserListComponent as c, AXPTenantChooserDropdownComponent as d, AXPAppChooserListComponent as e, AXMUserDeviceSessionsService as f, AXMAuthErrorHandler as g, AXMDefaultAuthConfigs as h, configAuthModule as i, AXMAuthModule as j, AXMSessionStatusTypes as k, AXPIdleService as l, AXMDeviceSessionsService as m, AXMDeviceSessionsServiceImpl as n, canActivateLogin as o };
792
+ //# sourceMappingURL=acorex-modules-auth-acorex-modules-auth-Dg9sg98-.mjs.map