@abpjs/identity 3.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +73 -213
- package/dist/index.d.ts +73 -213
- package/dist/index.js +52 -227
- package/dist/index.mjs +52 -226
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -24,7 +24,6 @@ __export(index_exports, {
|
|
|
24
24
|
IDENTITY_ROUTE_PATHS: () => IDENTITY_ROUTE_PATHS,
|
|
25
25
|
IDENTITY_ROUTE_PROVIDERS: () => IDENTITY_ROUTE_PROVIDERS,
|
|
26
26
|
IdentityRoleService: () => IdentityRoleService,
|
|
27
|
-
IdentityService: () => IdentityService,
|
|
28
27
|
IdentityStateService: () => IdentityStateService,
|
|
29
28
|
IdentityUserLookupService: () => IdentityUserLookupService,
|
|
30
29
|
IdentityUserService: () => IdentityUserService,
|
|
@@ -77,9 +76,9 @@ var eIdentityRouteNames = {
|
|
|
77
76
|
|
|
78
77
|
// src/config/providers/route.provider.ts
|
|
79
78
|
var import_core = require("@abpjs/core");
|
|
80
|
-
function configureRoutes(
|
|
79
|
+
function configureRoutes(routesService) {
|
|
81
80
|
return () => {
|
|
82
|
-
|
|
81
|
+
routesService.add([
|
|
83
82
|
{
|
|
84
83
|
path: "/identity",
|
|
85
84
|
name: eIdentityRouteNames.IdentityManagement,
|
|
@@ -110,8 +109,8 @@ var IDENTITY_ROUTE_PROVIDERS = {
|
|
|
110
109
|
configureRoutes
|
|
111
110
|
};
|
|
112
111
|
function initializeIdentityRoutes() {
|
|
113
|
-
const
|
|
114
|
-
const addRoutes = configureRoutes(
|
|
112
|
+
const routesService = (0, import_core.getRoutesService)();
|
|
113
|
+
const addRoutes = configureRoutes(routesService);
|
|
115
114
|
addRoutes();
|
|
116
115
|
}
|
|
117
116
|
|
|
@@ -437,192 +436,23 @@ var ProfileService = class {
|
|
|
437
436
|
}
|
|
438
437
|
};
|
|
439
438
|
|
|
440
|
-
// src/services/identity.service.ts
|
|
441
|
-
var IdentityService = class {
|
|
442
|
-
constructor(rest) {
|
|
443
|
-
/**
|
|
444
|
-
* The API name used for REST requests.
|
|
445
|
-
* @since 2.4.0
|
|
446
|
-
*/
|
|
447
|
-
this.apiName = "default";
|
|
448
|
-
this.rest = rest;
|
|
449
|
-
}
|
|
450
|
-
// ========================
|
|
451
|
-
// Role Operations
|
|
452
|
-
// ========================
|
|
453
|
-
/**
|
|
454
|
-
* Get all roles with optional pagination/filtering (v0.9.0)
|
|
455
|
-
* @param params - Optional query parameters for pagination and filtering
|
|
456
|
-
* @returns Promise with paginated role response
|
|
457
|
-
*/
|
|
458
|
-
getRoles(params = {}) {
|
|
459
|
-
return this.rest.request({
|
|
460
|
-
method: "GET",
|
|
461
|
-
url: "/api/identity/roles",
|
|
462
|
-
params
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* Get all roles without pagination.
|
|
467
|
-
* Fetches all roles in a single request.
|
|
468
|
-
* @since 2.4.0
|
|
469
|
-
* @returns Promise with all roles
|
|
470
|
-
*/
|
|
471
|
-
getAllRoles() {
|
|
472
|
-
return this.rest.request({
|
|
473
|
-
method: "GET",
|
|
474
|
-
url: "/api/identity/roles/all"
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* Get a role by ID
|
|
479
|
-
* @param id - The role ID
|
|
480
|
-
* @returns Promise with the role item
|
|
481
|
-
*/
|
|
482
|
-
getRoleById(id) {
|
|
483
|
-
return this.rest.request({
|
|
484
|
-
method: "GET",
|
|
485
|
-
url: `/api/identity/roles/${id}`
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
/**
|
|
489
|
-
* Delete a role
|
|
490
|
-
* @param id - The role ID to delete
|
|
491
|
-
* @returns Promise with the deleted role
|
|
492
|
-
*/
|
|
493
|
-
deleteRole(id) {
|
|
494
|
-
return this.rest.request({
|
|
495
|
-
method: "DELETE",
|
|
496
|
-
url: `/api/identity/roles/${id}`
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
/**
|
|
500
|
-
* Create a new role
|
|
501
|
-
* @param body - The role data to create
|
|
502
|
-
* @returns Promise with the created role
|
|
503
|
-
*/
|
|
504
|
-
createRole(body) {
|
|
505
|
-
return this.rest.request({
|
|
506
|
-
method: "POST",
|
|
507
|
-
url: "/api/identity/roles",
|
|
508
|
-
body
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
/**
|
|
512
|
-
* Update an existing role
|
|
513
|
-
* @param id - The role ID to update
|
|
514
|
-
* @param body - The updated role data
|
|
515
|
-
* @returns Promise with the updated role
|
|
516
|
-
*/
|
|
517
|
-
updateRole(id, body) {
|
|
518
|
-
return this.rest.request({
|
|
519
|
-
method: "PUT",
|
|
520
|
-
url: `/api/identity/roles/${id}`,
|
|
521
|
-
body
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
// ========================
|
|
525
|
-
// User Operations
|
|
526
|
-
// ========================
|
|
527
|
-
/**
|
|
528
|
-
* Get users with pagination and filtering
|
|
529
|
-
* @param params - Query parameters for pagination and filtering
|
|
530
|
-
* @returns Promise with paginated user response
|
|
531
|
-
*/
|
|
532
|
-
getUsers(params = {}) {
|
|
533
|
-
return this.rest.request({
|
|
534
|
-
method: "GET",
|
|
535
|
-
url: "/api/identity/users",
|
|
536
|
-
params
|
|
537
|
-
});
|
|
538
|
-
}
|
|
539
|
-
/**
|
|
540
|
-
* Get a user by ID
|
|
541
|
-
* @param id - The user ID
|
|
542
|
-
* @returns Promise with the user item
|
|
543
|
-
*/
|
|
544
|
-
getUserById(id) {
|
|
545
|
-
return this.rest.request({
|
|
546
|
-
method: "GET",
|
|
547
|
-
url: `/api/identity/users/${id}`
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
|
-
/**
|
|
551
|
-
* Get roles assigned to a user
|
|
552
|
-
* @param id - The user ID
|
|
553
|
-
* @returns Promise with the user's roles
|
|
554
|
-
*/
|
|
555
|
-
getUserRoles(id) {
|
|
556
|
-
return this.rest.request({
|
|
557
|
-
method: "GET",
|
|
558
|
-
url: `/api/identity/users/${id}/roles`
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* Get all roles that can be assigned to users.
|
|
563
|
-
* This returns the list of available roles for user assignment.
|
|
564
|
-
* @since 3.0.0
|
|
565
|
-
* @returns Promise with assignable roles
|
|
566
|
-
*/
|
|
567
|
-
getUserAssignableRoles() {
|
|
568
|
-
return this.rest.request({
|
|
569
|
-
method: "GET",
|
|
570
|
-
url: "/api/identity/users/assignable-roles"
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* Delete a user
|
|
575
|
-
* @param id - The user ID to delete
|
|
576
|
-
* @returns Promise resolving when complete
|
|
577
|
-
*/
|
|
578
|
-
deleteUser(id) {
|
|
579
|
-
return this.rest.request({
|
|
580
|
-
method: "DELETE",
|
|
581
|
-
url: `/api/identity/users/${id}`
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
/**
|
|
585
|
-
* Create a new user
|
|
586
|
-
* @param body - The user data to create
|
|
587
|
-
* @returns Promise with the created user
|
|
588
|
-
*/
|
|
589
|
-
createUser(body) {
|
|
590
|
-
return this.rest.request({
|
|
591
|
-
method: "POST",
|
|
592
|
-
url: "/api/identity/users",
|
|
593
|
-
body
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* Update an existing user
|
|
598
|
-
* @param id - The user ID to update
|
|
599
|
-
* @param body - The updated user data
|
|
600
|
-
* @returns Promise with the updated user
|
|
601
|
-
*/
|
|
602
|
-
updateUser(id, body) {
|
|
603
|
-
return this.rest.request({
|
|
604
|
-
method: "PUT",
|
|
605
|
-
url: `/api/identity/users/${id}`,
|
|
606
|
-
body
|
|
607
|
-
});
|
|
608
|
-
}
|
|
609
|
-
};
|
|
610
|
-
|
|
611
439
|
// src/services/identity-state.service.ts
|
|
612
440
|
var IdentityStateService = class {
|
|
613
|
-
constructor(
|
|
441
|
+
constructor(identityRoleService, identityUserService) {
|
|
614
442
|
// Internal state
|
|
615
443
|
this.roles = [];
|
|
616
444
|
this.rolesTotalCount = 0;
|
|
617
445
|
this.users = [];
|
|
618
446
|
this.usersTotalCount = 0;
|
|
619
|
-
this.
|
|
447
|
+
this.identityRoleService = identityRoleService;
|
|
448
|
+
this.identityUserService = identityUserService;
|
|
620
449
|
}
|
|
621
450
|
// ========================
|
|
622
451
|
// State Getters
|
|
623
452
|
// ========================
|
|
624
453
|
/**
|
|
625
454
|
* Get the current roles from state
|
|
455
|
+
* @updated 4.0.0 - Returns IdentityRoleDto[] instead of Identity.RoleItem[]
|
|
626
456
|
*/
|
|
627
457
|
getRoles() {
|
|
628
458
|
return this.roles;
|
|
@@ -635,6 +465,7 @@ var IdentityStateService = class {
|
|
|
635
465
|
}
|
|
636
466
|
/**
|
|
637
467
|
* Get the current users from state
|
|
468
|
+
* @updated 4.0.0 - Returns IdentityUserDto[] instead of Identity.UserItem[]
|
|
638
469
|
*/
|
|
639
470
|
getUsers() {
|
|
640
471
|
return this.users;
|
|
@@ -650,12 +481,12 @@ var IdentityStateService = class {
|
|
|
650
481
|
// ========================
|
|
651
482
|
/**
|
|
652
483
|
* Fetch roles and update internal state
|
|
653
|
-
* @param params - Optional
|
|
484
|
+
* @param params - Optional pagination/sorting parameters
|
|
654
485
|
*/
|
|
655
486
|
async dispatchGetRoles(params) {
|
|
656
|
-
const response = await this.
|
|
657
|
-
this.roles = response.items;
|
|
658
|
-
this.rolesTotalCount = response.totalCount;
|
|
487
|
+
const response = await this.identityRoleService.getList(params || {});
|
|
488
|
+
this.roles = response.items ?? [];
|
|
489
|
+
this.rolesTotalCount = response.totalCount ?? 0;
|
|
659
490
|
return response;
|
|
660
491
|
}
|
|
661
492
|
/**
|
|
@@ -663,23 +494,22 @@ var IdentityStateService = class {
|
|
|
663
494
|
* @param id - The role ID
|
|
664
495
|
*/
|
|
665
496
|
async dispatchGetRoleById(id) {
|
|
666
|
-
return this.
|
|
497
|
+
return this.identityRoleService.get(id);
|
|
667
498
|
}
|
|
668
499
|
/**
|
|
669
500
|
* Delete a role and refresh the list
|
|
670
501
|
* @param id - The role ID to delete
|
|
671
502
|
*/
|
|
672
503
|
async dispatchDeleteRole(id) {
|
|
673
|
-
|
|
504
|
+
await this.identityRoleService.delete(id);
|
|
674
505
|
await this.dispatchGetRoles();
|
|
675
|
-
return result;
|
|
676
506
|
}
|
|
677
507
|
/**
|
|
678
508
|
* Create a new role and refresh the list
|
|
679
509
|
* @param body - The role data to create
|
|
680
510
|
*/
|
|
681
511
|
async dispatchCreateRole(body) {
|
|
682
|
-
const result = await this.
|
|
512
|
+
const result = await this.identityRoleService.create(body);
|
|
683
513
|
await this.dispatchGetRoles();
|
|
684
514
|
return result;
|
|
685
515
|
}
|
|
@@ -688,7 +518,7 @@ var IdentityStateService = class {
|
|
|
688
518
|
* @param payload - Object containing id and updated role data
|
|
689
519
|
*/
|
|
690
520
|
async dispatchUpdateRole(payload) {
|
|
691
|
-
const result = await this.
|
|
521
|
+
const result = await this.identityRoleService.update(payload.id, payload.body);
|
|
692
522
|
await this.dispatchGetRoles();
|
|
693
523
|
return result;
|
|
694
524
|
}
|
|
@@ -700,9 +530,9 @@ var IdentityStateService = class {
|
|
|
700
530
|
* @param params - Optional query parameters for pagination/filtering
|
|
701
531
|
*/
|
|
702
532
|
async dispatchGetUsers(params) {
|
|
703
|
-
const response = await this.
|
|
704
|
-
this.users = response.items;
|
|
705
|
-
this.usersTotalCount = response.totalCount;
|
|
533
|
+
const response = await this.identityUserService.getList(params || {});
|
|
534
|
+
this.users = response.items ?? [];
|
|
535
|
+
this.usersTotalCount = response.totalCount ?? 0;
|
|
706
536
|
return response;
|
|
707
537
|
}
|
|
708
538
|
/**
|
|
@@ -710,14 +540,14 @@ var IdentityStateService = class {
|
|
|
710
540
|
* @param id - The user ID
|
|
711
541
|
*/
|
|
712
542
|
async dispatchGetUserById(id) {
|
|
713
|
-
return this.
|
|
543
|
+
return this.identityUserService.get(id);
|
|
714
544
|
}
|
|
715
545
|
/**
|
|
716
546
|
* Delete a user and refresh the list
|
|
717
547
|
* @param id - The user ID to delete
|
|
718
548
|
*/
|
|
719
549
|
async dispatchDeleteUser(id) {
|
|
720
|
-
await this.
|
|
550
|
+
await this.identityUserService.delete(id);
|
|
721
551
|
await this.dispatchGetUsers();
|
|
722
552
|
}
|
|
723
553
|
/**
|
|
@@ -725,7 +555,7 @@ var IdentityStateService = class {
|
|
|
725
555
|
* @param body - The user data to create
|
|
726
556
|
*/
|
|
727
557
|
async dispatchCreateUser(body) {
|
|
728
|
-
const result = await this.
|
|
558
|
+
const result = await this.identityUserService.create(body);
|
|
729
559
|
await this.dispatchGetUsers();
|
|
730
560
|
return result;
|
|
731
561
|
}
|
|
@@ -734,7 +564,7 @@ var IdentityStateService = class {
|
|
|
734
564
|
* @param payload - Object containing id and updated user data
|
|
735
565
|
*/
|
|
736
566
|
async dispatchUpdateUser(payload) {
|
|
737
|
-
const result = await this.
|
|
567
|
+
const result = await this.identityUserService.update(payload.id, payload.body);
|
|
738
568
|
await this.dispatchGetUsers();
|
|
739
569
|
return result;
|
|
740
570
|
}
|
|
@@ -743,7 +573,7 @@ var IdentityStateService = class {
|
|
|
743
573
|
* @param id - The user ID
|
|
744
574
|
*/
|
|
745
575
|
async dispatchGetUserRoles(id) {
|
|
746
|
-
return this.
|
|
576
|
+
return this.identityUserService.getRoles(id);
|
|
747
577
|
}
|
|
748
578
|
};
|
|
749
579
|
|
|
@@ -752,7 +582,7 @@ var import_react = require("react");
|
|
|
752
582
|
var import_core2 = require("@abpjs/core");
|
|
753
583
|
function useRoles() {
|
|
754
584
|
const restService = (0, import_core2.useRestService)();
|
|
755
|
-
const service = (0, import_react.useMemo)(() => new
|
|
585
|
+
const service = (0, import_react.useMemo)(() => new IdentityRoleService(restService), [restService]);
|
|
756
586
|
const [roles, setRoles] = (0, import_react.useState)([]);
|
|
757
587
|
const [totalCount, setTotalCount] = (0, import_react.useState)(0);
|
|
758
588
|
const [selectedRole, setSelectedRole] = (0, import_react.useState)(null);
|
|
@@ -764,7 +594,7 @@ function useRoles() {
|
|
|
764
594
|
setIsLoading(true);
|
|
765
595
|
setError(null);
|
|
766
596
|
try {
|
|
767
|
-
const response = await service.
|
|
597
|
+
const response = await service.getList(params || {});
|
|
768
598
|
setRoles(response.items || []);
|
|
769
599
|
setTotalCount(response.totalCount || 0);
|
|
770
600
|
setIsLoading(false);
|
|
@@ -781,7 +611,7 @@ function useRoles() {
|
|
|
781
611
|
setIsLoading(true);
|
|
782
612
|
setError(null);
|
|
783
613
|
try {
|
|
784
|
-
const role = await service.
|
|
614
|
+
const role = await service.get(id);
|
|
785
615
|
setSelectedRole(role);
|
|
786
616
|
setIsLoading(false);
|
|
787
617
|
return { success: true };
|
|
@@ -799,7 +629,7 @@ function useRoles() {
|
|
|
799
629
|
setIsLoading(true);
|
|
800
630
|
setError(null);
|
|
801
631
|
try {
|
|
802
|
-
await service.
|
|
632
|
+
await service.create(role);
|
|
803
633
|
await fetchRoles();
|
|
804
634
|
return { success: true };
|
|
805
635
|
} catch (err) {
|
|
@@ -816,7 +646,7 @@ function useRoles() {
|
|
|
816
646
|
setIsLoading(true);
|
|
817
647
|
setError(null);
|
|
818
648
|
try {
|
|
819
|
-
await service.
|
|
649
|
+
await service.update(id, role);
|
|
820
650
|
await fetchRoles();
|
|
821
651
|
return { success: true };
|
|
822
652
|
} catch (err) {
|
|
@@ -833,7 +663,7 @@ function useRoles() {
|
|
|
833
663
|
setIsLoading(true);
|
|
834
664
|
setError(null);
|
|
835
665
|
try {
|
|
836
|
-
await service.
|
|
666
|
+
await service.delete(id);
|
|
837
667
|
await fetchRoles();
|
|
838
668
|
return { success: true };
|
|
839
669
|
} catch (err) {
|
|
@@ -876,13 +706,14 @@ function useRoles() {
|
|
|
876
706
|
var import_react2 = require("react");
|
|
877
707
|
var import_core3 = require("@abpjs/core");
|
|
878
708
|
var DEFAULT_PAGE_QUERY = {
|
|
709
|
+
filter: "",
|
|
879
710
|
sorting: "userName",
|
|
880
711
|
skipCount: 0,
|
|
881
712
|
maxResultCount: 10
|
|
882
713
|
};
|
|
883
714
|
function useUsers() {
|
|
884
715
|
const restService = (0, import_core3.useRestService)();
|
|
885
|
-
const service = (0, import_react2.useMemo)(() => new
|
|
716
|
+
const service = (0, import_react2.useMemo)(() => new IdentityUserService(restService), [restService]);
|
|
886
717
|
const [users, setUsers] = (0, import_react2.useState)([]);
|
|
887
718
|
const [totalCount, setTotalCount] = (0, import_react2.useState)(0);
|
|
888
719
|
const [selectedUser, setSelectedUser] = (0, import_react2.useState)(null);
|
|
@@ -898,7 +729,7 @@ function useUsers() {
|
|
|
898
729
|
setError(null);
|
|
899
730
|
const queryParams = params || pageQuery;
|
|
900
731
|
try {
|
|
901
|
-
const response = await service.
|
|
732
|
+
const response = await service.getList(queryParams);
|
|
902
733
|
setUsers(response.items || []);
|
|
903
734
|
setTotalCount(response.totalCount || 0);
|
|
904
735
|
setIsLoading(false);
|
|
@@ -917,7 +748,7 @@ function useUsers() {
|
|
|
917
748
|
setIsLoading(true);
|
|
918
749
|
setError(null);
|
|
919
750
|
try {
|
|
920
|
-
const user = await service.
|
|
751
|
+
const user = await service.get(id);
|
|
921
752
|
setSelectedUser(user);
|
|
922
753
|
setIsLoading(false);
|
|
923
754
|
return { success: true };
|
|
@@ -935,7 +766,7 @@ function useUsers() {
|
|
|
935
766
|
setIsLoading(true);
|
|
936
767
|
setError(null);
|
|
937
768
|
try {
|
|
938
|
-
const response = await service.
|
|
769
|
+
const response = await service.getRoles(id);
|
|
939
770
|
setSelectedUserRoles(response.items || []);
|
|
940
771
|
setIsLoading(false);
|
|
941
772
|
return { success: true };
|
|
@@ -953,7 +784,7 @@ function useUsers() {
|
|
|
953
784
|
setIsLoading(true);
|
|
954
785
|
setError(null);
|
|
955
786
|
try {
|
|
956
|
-
await service.
|
|
787
|
+
await service.create(user);
|
|
957
788
|
await fetchUsers();
|
|
958
789
|
return { success: true };
|
|
959
790
|
} catch (err) {
|
|
@@ -970,7 +801,7 @@ function useUsers() {
|
|
|
970
801
|
setIsLoading(true);
|
|
971
802
|
setError(null);
|
|
972
803
|
try {
|
|
973
|
-
await service.
|
|
804
|
+
await service.update(id, user);
|
|
974
805
|
await fetchUsers();
|
|
975
806
|
return { success: true };
|
|
976
807
|
} catch (err) {
|
|
@@ -987,7 +818,7 @@ function useUsers() {
|
|
|
987
818
|
setIsLoading(true);
|
|
988
819
|
setError(null);
|
|
989
820
|
try {
|
|
990
|
-
await service.
|
|
821
|
+
await service.delete(id);
|
|
991
822
|
await fetchUsers();
|
|
992
823
|
return { success: true };
|
|
993
824
|
} catch (err) {
|
|
@@ -1157,11 +988,15 @@ function RolesComponent({
|
|
|
1157
988
|
const roleData = {
|
|
1158
989
|
name: formState.name.trim(),
|
|
1159
990
|
isDefault: formState.isDefault,
|
|
1160
|
-
isPublic: formState.isPublic
|
|
991
|
+
isPublic: formState.isPublic,
|
|
992
|
+
extraProperties: {}
|
|
1161
993
|
};
|
|
1162
994
|
let result;
|
|
1163
995
|
if (selectedRole?.id) {
|
|
1164
|
-
result = await updateRole(selectedRole.id,
|
|
996
|
+
result = await updateRole(selectedRole.id, {
|
|
997
|
+
...roleData,
|
|
998
|
+
concurrencyStamp: selectedRole.concurrencyStamp
|
|
999
|
+
});
|
|
1165
1000
|
if (result.success) {
|
|
1166
1001
|
onRoleUpdated?.({ ...selectedRole, ...roleData });
|
|
1167
1002
|
}
|
|
@@ -1310,7 +1145,6 @@ var DEFAULT_FORM_STATE2 = {
|
|
|
1310
1145
|
phoneNumber: "",
|
|
1311
1146
|
password: "",
|
|
1312
1147
|
lockoutEnabled: true,
|
|
1313
|
-
twoFactorEnabled: true,
|
|
1314
1148
|
roleNames: []
|
|
1315
1149
|
};
|
|
1316
1150
|
function getPasswordRuleLabel(rule, t) {
|
|
@@ -1375,7 +1209,7 @@ function UsersComponent({
|
|
|
1375
1209
|
(0, import_react6.useEffect)(() => {
|
|
1376
1210
|
const newQuery = {
|
|
1377
1211
|
...pageQuery,
|
|
1378
|
-
filter: debouncedSearchTerm ||
|
|
1212
|
+
filter: debouncedSearchTerm || "",
|
|
1379
1213
|
skipCount: 0
|
|
1380
1214
|
};
|
|
1381
1215
|
setPageQuery(newQuery);
|
|
@@ -1406,7 +1240,6 @@ function UsersComponent({
|
|
|
1406
1240
|
phoneNumber: selectedUser.phoneNumber || "",
|
|
1407
1241
|
password: "",
|
|
1408
1242
|
lockoutEnabled: selectedUser.lockoutEnabled ?? true,
|
|
1409
|
-
twoFactorEnabled: selectedUser.twoFactorEnabled ?? true,
|
|
1410
1243
|
roleNames: selectedRoleNames
|
|
1411
1244
|
});
|
|
1412
1245
|
}
|
|
@@ -1442,12 +1275,15 @@ function UsersComponent({
|
|
|
1442
1275
|
phoneNumber: formState.phoneNumber.trim(),
|
|
1443
1276
|
password: formState.password,
|
|
1444
1277
|
lockoutEnabled: formState.lockoutEnabled,
|
|
1445
|
-
|
|
1446
|
-
|
|
1278
|
+
roleNames: formState.roleNames,
|
|
1279
|
+
extraProperties: {}
|
|
1447
1280
|
};
|
|
1448
1281
|
let result;
|
|
1449
1282
|
if (selectedUser?.id) {
|
|
1450
|
-
result = await updateUser(selectedUser.id,
|
|
1283
|
+
result = await updateUser(selectedUser.id, {
|
|
1284
|
+
...userData,
|
|
1285
|
+
concurrencyStamp: selectedUser.concurrencyStamp
|
|
1286
|
+
});
|
|
1451
1287
|
if (result.success) {
|
|
1452
1288
|
onUserUpdated?.({
|
|
1453
1289
|
...selectedUser,
|
|
@@ -1460,10 +1296,8 @@ function UsersComponent({
|
|
|
1460
1296
|
onUserCreated?.({
|
|
1461
1297
|
...userData,
|
|
1462
1298
|
id: "",
|
|
1463
|
-
tenantId: "",
|
|
1464
1299
|
emailConfirmed: false,
|
|
1465
1300
|
phoneNumberConfirmed: false,
|
|
1466
|
-
isLockedOut: false,
|
|
1467
1301
|
concurrencyStamp: ""
|
|
1468
1302
|
});
|
|
1469
1303
|
}
|
|
@@ -1673,14 +1507,6 @@ function UsersComponent({
|
|
|
1673
1507
|
onChange: (e) => handleInputChange("lockoutEnabled", e.target.checked),
|
|
1674
1508
|
children: t("AbpIdentity::DisplayName:LockoutEnabled")
|
|
1675
1509
|
}
|
|
1676
|
-
),
|
|
1677
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1678
|
-
import_theme_shared2.Checkbox,
|
|
1679
|
-
{
|
|
1680
|
-
checked: formState.twoFactorEnabled,
|
|
1681
|
-
onChange: (e) => handleInputChange("twoFactorEnabled", e.target.checked),
|
|
1682
|
-
children: t("AbpIdentity::DisplayName:TwoFactorEnabled")
|
|
1683
|
-
}
|
|
1684
1510
|
)
|
|
1685
1511
|
] }) }),
|
|
1686
1512
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react7.Tabs.Content, { value: "roles", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react7.VStack, { gap: 2, align: "stretch", pt: 4, children: [
|
|
@@ -1747,7 +1573,6 @@ var IDENTITY_POLICIES = {
|
|
|
1747
1573
|
IDENTITY_ROUTE_PATHS,
|
|
1748
1574
|
IDENTITY_ROUTE_PROVIDERS,
|
|
1749
1575
|
IdentityRoleService,
|
|
1750
|
-
IdentityService,
|
|
1751
1576
|
IdentityStateService,
|
|
1752
1577
|
IdentityUserLookupService,
|
|
1753
1578
|
IdentityUserService,
|