@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.mjs
CHANGED
|
@@ -33,9 +33,9 @@ var eIdentityRouteNames = {
|
|
|
33
33
|
|
|
34
34
|
// src/config/providers/route.provider.ts
|
|
35
35
|
import { getRoutesService, eLayoutType } from "@abpjs/core";
|
|
36
|
-
function configureRoutes(
|
|
36
|
+
function configureRoutes(routesService) {
|
|
37
37
|
return () => {
|
|
38
|
-
|
|
38
|
+
routesService.add([
|
|
39
39
|
{
|
|
40
40
|
path: "/identity",
|
|
41
41
|
name: eIdentityRouteNames.IdentityManagement,
|
|
@@ -66,8 +66,8 @@ var IDENTITY_ROUTE_PROVIDERS = {
|
|
|
66
66
|
configureRoutes
|
|
67
67
|
};
|
|
68
68
|
function initializeIdentityRoutes() {
|
|
69
|
-
const
|
|
70
|
-
const addRoutes = configureRoutes(
|
|
69
|
+
const routesService = getRoutesService();
|
|
70
|
+
const addRoutes = configureRoutes(routesService);
|
|
71
71
|
addRoutes();
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -393,192 +393,23 @@ var ProfileService = class {
|
|
|
393
393
|
}
|
|
394
394
|
};
|
|
395
395
|
|
|
396
|
-
// src/services/identity.service.ts
|
|
397
|
-
var IdentityService = class {
|
|
398
|
-
constructor(rest) {
|
|
399
|
-
/**
|
|
400
|
-
* The API name used for REST requests.
|
|
401
|
-
* @since 2.4.0
|
|
402
|
-
*/
|
|
403
|
-
this.apiName = "default";
|
|
404
|
-
this.rest = rest;
|
|
405
|
-
}
|
|
406
|
-
// ========================
|
|
407
|
-
// Role Operations
|
|
408
|
-
// ========================
|
|
409
|
-
/**
|
|
410
|
-
* Get all roles with optional pagination/filtering (v0.9.0)
|
|
411
|
-
* @param params - Optional query parameters for pagination and filtering
|
|
412
|
-
* @returns Promise with paginated role response
|
|
413
|
-
*/
|
|
414
|
-
getRoles(params = {}) {
|
|
415
|
-
return this.rest.request({
|
|
416
|
-
method: "GET",
|
|
417
|
-
url: "/api/identity/roles",
|
|
418
|
-
params
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* Get all roles without pagination.
|
|
423
|
-
* Fetches all roles in a single request.
|
|
424
|
-
* @since 2.4.0
|
|
425
|
-
* @returns Promise with all roles
|
|
426
|
-
*/
|
|
427
|
-
getAllRoles() {
|
|
428
|
-
return this.rest.request({
|
|
429
|
-
method: "GET",
|
|
430
|
-
url: "/api/identity/roles/all"
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* Get a role by ID
|
|
435
|
-
* @param id - The role ID
|
|
436
|
-
* @returns Promise with the role item
|
|
437
|
-
*/
|
|
438
|
-
getRoleById(id) {
|
|
439
|
-
return this.rest.request({
|
|
440
|
-
method: "GET",
|
|
441
|
-
url: `/api/identity/roles/${id}`
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* Delete a role
|
|
446
|
-
* @param id - The role ID to delete
|
|
447
|
-
* @returns Promise with the deleted role
|
|
448
|
-
*/
|
|
449
|
-
deleteRole(id) {
|
|
450
|
-
return this.rest.request({
|
|
451
|
-
method: "DELETE",
|
|
452
|
-
url: `/api/identity/roles/${id}`
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
/**
|
|
456
|
-
* Create a new role
|
|
457
|
-
* @param body - The role data to create
|
|
458
|
-
* @returns Promise with the created role
|
|
459
|
-
*/
|
|
460
|
-
createRole(body) {
|
|
461
|
-
return this.rest.request({
|
|
462
|
-
method: "POST",
|
|
463
|
-
url: "/api/identity/roles",
|
|
464
|
-
body
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Update an existing role
|
|
469
|
-
* @param id - The role ID to update
|
|
470
|
-
* @param body - The updated role data
|
|
471
|
-
* @returns Promise with the updated role
|
|
472
|
-
*/
|
|
473
|
-
updateRole(id, body) {
|
|
474
|
-
return this.rest.request({
|
|
475
|
-
method: "PUT",
|
|
476
|
-
url: `/api/identity/roles/${id}`,
|
|
477
|
-
body
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
// ========================
|
|
481
|
-
// User Operations
|
|
482
|
-
// ========================
|
|
483
|
-
/**
|
|
484
|
-
* Get users with pagination and filtering
|
|
485
|
-
* @param params - Query parameters for pagination and filtering
|
|
486
|
-
* @returns Promise with paginated user response
|
|
487
|
-
*/
|
|
488
|
-
getUsers(params = {}) {
|
|
489
|
-
return this.rest.request({
|
|
490
|
-
method: "GET",
|
|
491
|
-
url: "/api/identity/users",
|
|
492
|
-
params
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
/**
|
|
496
|
-
* Get a user by ID
|
|
497
|
-
* @param id - The user ID
|
|
498
|
-
* @returns Promise with the user item
|
|
499
|
-
*/
|
|
500
|
-
getUserById(id) {
|
|
501
|
-
return this.rest.request({
|
|
502
|
-
method: "GET",
|
|
503
|
-
url: `/api/identity/users/${id}`
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
/**
|
|
507
|
-
* Get roles assigned to a user
|
|
508
|
-
* @param id - The user ID
|
|
509
|
-
* @returns Promise with the user's roles
|
|
510
|
-
*/
|
|
511
|
-
getUserRoles(id) {
|
|
512
|
-
return this.rest.request({
|
|
513
|
-
method: "GET",
|
|
514
|
-
url: `/api/identity/users/${id}/roles`
|
|
515
|
-
});
|
|
516
|
-
}
|
|
517
|
-
/**
|
|
518
|
-
* Get all roles that can be assigned to users.
|
|
519
|
-
* This returns the list of available roles for user assignment.
|
|
520
|
-
* @since 3.0.0
|
|
521
|
-
* @returns Promise with assignable roles
|
|
522
|
-
*/
|
|
523
|
-
getUserAssignableRoles() {
|
|
524
|
-
return this.rest.request({
|
|
525
|
-
method: "GET",
|
|
526
|
-
url: "/api/identity/users/assignable-roles"
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
|
-
/**
|
|
530
|
-
* Delete a user
|
|
531
|
-
* @param id - The user ID to delete
|
|
532
|
-
* @returns Promise resolving when complete
|
|
533
|
-
*/
|
|
534
|
-
deleteUser(id) {
|
|
535
|
-
return this.rest.request({
|
|
536
|
-
method: "DELETE",
|
|
537
|
-
url: `/api/identity/users/${id}`
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
/**
|
|
541
|
-
* Create a new user
|
|
542
|
-
* @param body - The user data to create
|
|
543
|
-
* @returns Promise with the created user
|
|
544
|
-
*/
|
|
545
|
-
createUser(body) {
|
|
546
|
-
return this.rest.request({
|
|
547
|
-
method: "POST",
|
|
548
|
-
url: "/api/identity/users",
|
|
549
|
-
body
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
/**
|
|
553
|
-
* Update an existing user
|
|
554
|
-
* @param id - The user ID to update
|
|
555
|
-
* @param body - The updated user data
|
|
556
|
-
* @returns Promise with the updated user
|
|
557
|
-
*/
|
|
558
|
-
updateUser(id, body) {
|
|
559
|
-
return this.rest.request({
|
|
560
|
-
method: "PUT",
|
|
561
|
-
url: `/api/identity/users/${id}`,
|
|
562
|
-
body
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
};
|
|
566
|
-
|
|
567
396
|
// src/services/identity-state.service.ts
|
|
568
397
|
var IdentityStateService = class {
|
|
569
|
-
constructor(
|
|
398
|
+
constructor(identityRoleService, identityUserService) {
|
|
570
399
|
// Internal state
|
|
571
400
|
this.roles = [];
|
|
572
401
|
this.rolesTotalCount = 0;
|
|
573
402
|
this.users = [];
|
|
574
403
|
this.usersTotalCount = 0;
|
|
575
|
-
this.
|
|
404
|
+
this.identityRoleService = identityRoleService;
|
|
405
|
+
this.identityUserService = identityUserService;
|
|
576
406
|
}
|
|
577
407
|
// ========================
|
|
578
408
|
// State Getters
|
|
579
409
|
// ========================
|
|
580
410
|
/**
|
|
581
411
|
* Get the current roles from state
|
|
412
|
+
* @updated 4.0.0 - Returns IdentityRoleDto[] instead of Identity.RoleItem[]
|
|
582
413
|
*/
|
|
583
414
|
getRoles() {
|
|
584
415
|
return this.roles;
|
|
@@ -591,6 +422,7 @@ var IdentityStateService = class {
|
|
|
591
422
|
}
|
|
592
423
|
/**
|
|
593
424
|
* Get the current users from state
|
|
425
|
+
* @updated 4.0.0 - Returns IdentityUserDto[] instead of Identity.UserItem[]
|
|
594
426
|
*/
|
|
595
427
|
getUsers() {
|
|
596
428
|
return this.users;
|
|
@@ -606,12 +438,12 @@ var IdentityStateService = class {
|
|
|
606
438
|
// ========================
|
|
607
439
|
/**
|
|
608
440
|
* Fetch roles and update internal state
|
|
609
|
-
* @param params - Optional
|
|
441
|
+
* @param params - Optional pagination/sorting parameters
|
|
610
442
|
*/
|
|
611
443
|
async dispatchGetRoles(params) {
|
|
612
|
-
const response = await this.
|
|
613
|
-
this.roles = response.items;
|
|
614
|
-
this.rolesTotalCount = response.totalCount;
|
|
444
|
+
const response = await this.identityRoleService.getList(params || {});
|
|
445
|
+
this.roles = response.items ?? [];
|
|
446
|
+
this.rolesTotalCount = response.totalCount ?? 0;
|
|
615
447
|
return response;
|
|
616
448
|
}
|
|
617
449
|
/**
|
|
@@ -619,23 +451,22 @@ var IdentityStateService = class {
|
|
|
619
451
|
* @param id - The role ID
|
|
620
452
|
*/
|
|
621
453
|
async dispatchGetRoleById(id) {
|
|
622
|
-
return this.
|
|
454
|
+
return this.identityRoleService.get(id);
|
|
623
455
|
}
|
|
624
456
|
/**
|
|
625
457
|
* Delete a role and refresh the list
|
|
626
458
|
* @param id - The role ID to delete
|
|
627
459
|
*/
|
|
628
460
|
async dispatchDeleteRole(id) {
|
|
629
|
-
|
|
461
|
+
await this.identityRoleService.delete(id);
|
|
630
462
|
await this.dispatchGetRoles();
|
|
631
|
-
return result;
|
|
632
463
|
}
|
|
633
464
|
/**
|
|
634
465
|
* Create a new role and refresh the list
|
|
635
466
|
* @param body - The role data to create
|
|
636
467
|
*/
|
|
637
468
|
async dispatchCreateRole(body) {
|
|
638
|
-
const result = await this.
|
|
469
|
+
const result = await this.identityRoleService.create(body);
|
|
639
470
|
await this.dispatchGetRoles();
|
|
640
471
|
return result;
|
|
641
472
|
}
|
|
@@ -644,7 +475,7 @@ var IdentityStateService = class {
|
|
|
644
475
|
* @param payload - Object containing id and updated role data
|
|
645
476
|
*/
|
|
646
477
|
async dispatchUpdateRole(payload) {
|
|
647
|
-
const result = await this.
|
|
478
|
+
const result = await this.identityRoleService.update(payload.id, payload.body);
|
|
648
479
|
await this.dispatchGetRoles();
|
|
649
480
|
return result;
|
|
650
481
|
}
|
|
@@ -656,9 +487,9 @@ var IdentityStateService = class {
|
|
|
656
487
|
* @param params - Optional query parameters for pagination/filtering
|
|
657
488
|
*/
|
|
658
489
|
async dispatchGetUsers(params) {
|
|
659
|
-
const response = await this.
|
|
660
|
-
this.users = response.items;
|
|
661
|
-
this.usersTotalCount = response.totalCount;
|
|
490
|
+
const response = await this.identityUserService.getList(params || {});
|
|
491
|
+
this.users = response.items ?? [];
|
|
492
|
+
this.usersTotalCount = response.totalCount ?? 0;
|
|
662
493
|
return response;
|
|
663
494
|
}
|
|
664
495
|
/**
|
|
@@ -666,14 +497,14 @@ var IdentityStateService = class {
|
|
|
666
497
|
* @param id - The user ID
|
|
667
498
|
*/
|
|
668
499
|
async dispatchGetUserById(id) {
|
|
669
|
-
return this.
|
|
500
|
+
return this.identityUserService.get(id);
|
|
670
501
|
}
|
|
671
502
|
/**
|
|
672
503
|
* Delete a user and refresh the list
|
|
673
504
|
* @param id - The user ID to delete
|
|
674
505
|
*/
|
|
675
506
|
async dispatchDeleteUser(id) {
|
|
676
|
-
await this.
|
|
507
|
+
await this.identityUserService.delete(id);
|
|
677
508
|
await this.dispatchGetUsers();
|
|
678
509
|
}
|
|
679
510
|
/**
|
|
@@ -681,7 +512,7 @@ var IdentityStateService = class {
|
|
|
681
512
|
* @param body - The user data to create
|
|
682
513
|
*/
|
|
683
514
|
async dispatchCreateUser(body) {
|
|
684
|
-
const result = await this.
|
|
515
|
+
const result = await this.identityUserService.create(body);
|
|
685
516
|
await this.dispatchGetUsers();
|
|
686
517
|
return result;
|
|
687
518
|
}
|
|
@@ -690,7 +521,7 @@ var IdentityStateService = class {
|
|
|
690
521
|
* @param payload - Object containing id and updated user data
|
|
691
522
|
*/
|
|
692
523
|
async dispatchUpdateUser(payload) {
|
|
693
|
-
const result = await this.
|
|
524
|
+
const result = await this.identityUserService.update(payload.id, payload.body);
|
|
694
525
|
await this.dispatchGetUsers();
|
|
695
526
|
return result;
|
|
696
527
|
}
|
|
@@ -699,7 +530,7 @@ var IdentityStateService = class {
|
|
|
699
530
|
* @param id - The user ID
|
|
700
531
|
*/
|
|
701
532
|
async dispatchGetUserRoles(id) {
|
|
702
|
-
return this.
|
|
533
|
+
return this.identityUserService.getRoles(id);
|
|
703
534
|
}
|
|
704
535
|
};
|
|
705
536
|
|
|
@@ -708,7 +539,7 @@ import { useState, useCallback, useMemo } from "react";
|
|
|
708
539
|
import { useRestService } from "@abpjs/core";
|
|
709
540
|
function useRoles() {
|
|
710
541
|
const restService = useRestService();
|
|
711
|
-
const service = useMemo(() => new
|
|
542
|
+
const service = useMemo(() => new IdentityRoleService(restService), [restService]);
|
|
712
543
|
const [roles, setRoles] = useState([]);
|
|
713
544
|
const [totalCount, setTotalCount] = useState(0);
|
|
714
545
|
const [selectedRole, setSelectedRole] = useState(null);
|
|
@@ -720,7 +551,7 @@ function useRoles() {
|
|
|
720
551
|
setIsLoading(true);
|
|
721
552
|
setError(null);
|
|
722
553
|
try {
|
|
723
|
-
const response = await service.
|
|
554
|
+
const response = await service.getList(params || {});
|
|
724
555
|
setRoles(response.items || []);
|
|
725
556
|
setTotalCount(response.totalCount || 0);
|
|
726
557
|
setIsLoading(false);
|
|
@@ -737,7 +568,7 @@ function useRoles() {
|
|
|
737
568
|
setIsLoading(true);
|
|
738
569
|
setError(null);
|
|
739
570
|
try {
|
|
740
|
-
const role = await service.
|
|
571
|
+
const role = await service.get(id);
|
|
741
572
|
setSelectedRole(role);
|
|
742
573
|
setIsLoading(false);
|
|
743
574
|
return { success: true };
|
|
@@ -755,7 +586,7 @@ function useRoles() {
|
|
|
755
586
|
setIsLoading(true);
|
|
756
587
|
setError(null);
|
|
757
588
|
try {
|
|
758
|
-
await service.
|
|
589
|
+
await service.create(role);
|
|
759
590
|
await fetchRoles();
|
|
760
591
|
return { success: true };
|
|
761
592
|
} catch (err) {
|
|
@@ -772,7 +603,7 @@ function useRoles() {
|
|
|
772
603
|
setIsLoading(true);
|
|
773
604
|
setError(null);
|
|
774
605
|
try {
|
|
775
|
-
await service.
|
|
606
|
+
await service.update(id, role);
|
|
776
607
|
await fetchRoles();
|
|
777
608
|
return { success: true };
|
|
778
609
|
} catch (err) {
|
|
@@ -789,7 +620,7 @@ function useRoles() {
|
|
|
789
620
|
setIsLoading(true);
|
|
790
621
|
setError(null);
|
|
791
622
|
try {
|
|
792
|
-
await service.
|
|
623
|
+
await service.delete(id);
|
|
793
624
|
await fetchRoles();
|
|
794
625
|
return { success: true };
|
|
795
626
|
} catch (err) {
|
|
@@ -832,13 +663,14 @@ function useRoles() {
|
|
|
832
663
|
import { useState as useState2, useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
833
664
|
import { useRestService as useRestService2 } from "@abpjs/core";
|
|
834
665
|
var DEFAULT_PAGE_QUERY = {
|
|
666
|
+
filter: "",
|
|
835
667
|
sorting: "userName",
|
|
836
668
|
skipCount: 0,
|
|
837
669
|
maxResultCount: 10
|
|
838
670
|
};
|
|
839
671
|
function useUsers() {
|
|
840
672
|
const restService = useRestService2();
|
|
841
|
-
const service = useMemo2(() => new
|
|
673
|
+
const service = useMemo2(() => new IdentityUserService(restService), [restService]);
|
|
842
674
|
const [users, setUsers] = useState2([]);
|
|
843
675
|
const [totalCount, setTotalCount] = useState2(0);
|
|
844
676
|
const [selectedUser, setSelectedUser] = useState2(null);
|
|
@@ -854,7 +686,7 @@ function useUsers() {
|
|
|
854
686
|
setError(null);
|
|
855
687
|
const queryParams = params || pageQuery;
|
|
856
688
|
try {
|
|
857
|
-
const response = await service.
|
|
689
|
+
const response = await service.getList(queryParams);
|
|
858
690
|
setUsers(response.items || []);
|
|
859
691
|
setTotalCount(response.totalCount || 0);
|
|
860
692
|
setIsLoading(false);
|
|
@@ -873,7 +705,7 @@ function useUsers() {
|
|
|
873
705
|
setIsLoading(true);
|
|
874
706
|
setError(null);
|
|
875
707
|
try {
|
|
876
|
-
const user = await service.
|
|
708
|
+
const user = await service.get(id);
|
|
877
709
|
setSelectedUser(user);
|
|
878
710
|
setIsLoading(false);
|
|
879
711
|
return { success: true };
|
|
@@ -891,7 +723,7 @@ function useUsers() {
|
|
|
891
723
|
setIsLoading(true);
|
|
892
724
|
setError(null);
|
|
893
725
|
try {
|
|
894
|
-
const response = await service.
|
|
726
|
+
const response = await service.getRoles(id);
|
|
895
727
|
setSelectedUserRoles(response.items || []);
|
|
896
728
|
setIsLoading(false);
|
|
897
729
|
return { success: true };
|
|
@@ -909,7 +741,7 @@ function useUsers() {
|
|
|
909
741
|
setIsLoading(true);
|
|
910
742
|
setError(null);
|
|
911
743
|
try {
|
|
912
|
-
await service.
|
|
744
|
+
await service.create(user);
|
|
913
745
|
await fetchUsers();
|
|
914
746
|
return { success: true };
|
|
915
747
|
} catch (err) {
|
|
@@ -926,7 +758,7 @@ function useUsers() {
|
|
|
926
758
|
setIsLoading(true);
|
|
927
759
|
setError(null);
|
|
928
760
|
try {
|
|
929
|
-
await service.
|
|
761
|
+
await service.update(id, user);
|
|
930
762
|
await fetchUsers();
|
|
931
763
|
return { success: true };
|
|
932
764
|
} catch (err) {
|
|
@@ -943,7 +775,7 @@ function useUsers() {
|
|
|
943
775
|
setIsLoading(true);
|
|
944
776
|
setError(null);
|
|
945
777
|
try {
|
|
946
|
-
await service.
|
|
778
|
+
await service.delete(id);
|
|
947
779
|
await fetchUsers();
|
|
948
780
|
return { success: true };
|
|
949
781
|
} catch (err) {
|
|
@@ -1122,11 +954,15 @@ function RolesComponent({
|
|
|
1122
954
|
const roleData = {
|
|
1123
955
|
name: formState.name.trim(),
|
|
1124
956
|
isDefault: formState.isDefault,
|
|
1125
|
-
isPublic: formState.isPublic
|
|
957
|
+
isPublic: formState.isPublic,
|
|
958
|
+
extraProperties: {}
|
|
1126
959
|
};
|
|
1127
960
|
let result;
|
|
1128
961
|
if (selectedRole?.id) {
|
|
1129
|
-
result = await updateRole(selectedRole.id,
|
|
962
|
+
result = await updateRole(selectedRole.id, {
|
|
963
|
+
...roleData,
|
|
964
|
+
concurrencyStamp: selectedRole.concurrencyStamp
|
|
965
|
+
});
|
|
1130
966
|
if (result.success) {
|
|
1131
967
|
onRoleUpdated?.({ ...selectedRole, ...roleData });
|
|
1132
968
|
}
|
|
@@ -1286,7 +1122,6 @@ var DEFAULT_FORM_STATE2 = {
|
|
|
1286
1122
|
phoneNumber: "",
|
|
1287
1123
|
password: "",
|
|
1288
1124
|
lockoutEnabled: true,
|
|
1289
|
-
twoFactorEnabled: true,
|
|
1290
1125
|
roleNames: []
|
|
1291
1126
|
};
|
|
1292
1127
|
function getPasswordRuleLabel(rule, t) {
|
|
@@ -1351,7 +1186,7 @@ function UsersComponent({
|
|
|
1351
1186
|
useEffect2(() => {
|
|
1352
1187
|
const newQuery = {
|
|
1353
1188
|
...pageQuery,
|
|
1354
|
-
filter: debouncedSearchTerm ||
|
|
1189
|
+
filter: debouncedSearchTerm || "",
|
|
1355
1190
|
skipCount: 0
|
|
1356
1191
|
};
|
|
1357
1192
|
setPageQuery(newQuery);
|
|
@@ -1382,7 +1217,6 @@ function UsersComponent({
|
|
|
1382
1217
|
phoneNumber: selectedUser.phoneNumber || "",
|
|
1383
1218
|
password: "",
|
|
1384
1219
|
lockoutEnabled: selectedUser.lockoutEnabled ?? true,
|
|
1385
|
-
twoFactorEnabled: selectedUser.twoFactorEnabled ?? true,
|
|
1386
1220
|
roleNames: selectedRoleNames
|
|
1387
1221
|
});
|
|
1388
1222
|
}
|
|
@@ -1418,12 +1252,15 @@ function UsersComponent({
|
|
|
1418
1252
|
phoneNumber: formState.phoneNumber.trim(),
|
|
1419
1253
|
password: formState.password,
|
|
1420
1254
|
lockoutEnabled: formState.lockoutEnabled,
|
|
1421
|
-
|
|
1422
|
-
|
|
1255
|
+
roleNames: formState.roleNames,
|
|
1256
|
+
extraProperties: {}
|
|
1423
1257
|
};
|
|
1424
1258
|
let result;
|
|
1425
1259
|
if (selectedUser?.id) {
|
|
1426
|
-
result = await updateUser(selectedUser.id,
|
|
1260
|
+
result = await updateUser(selectedUser.id, {
|
|
1261
|
+
...userData,
|
|
1262
|
+
concurrencyStamp: selectedUser.concurrencyStamp
|
|
1263
|
+
});
|
|
1427
1264
|
if (result.success) {
|
|
1428
1265
|
onUserUpdated?.({
|
|
1429
1266
|
...selectedUser,
|
|
@@ -1436,10 +1273,8 @@ function UsersComponent({
|
|
|
1436
1273
|
onUserCreated?.({
|
|
1437
1274
|
...userData,
|
|
1438
1275
|
id: "",
|
|
1439
|
-
tenantId: "",
|
|
1440
1276
|
emailConfirmed: false,
|
|
1441
1277
|
phoneNumberConfirmed: false,
|
|
1442
|
-
isLockedOut: false,
|
|
1443
1278
|
concurrencyStamp: ""
|
|
1444
1279
|
});
|
|
1445
1280
|
}
|
|
@@ -1649,14 +1484,6 @@ function UsersComponent({
|
|
|
1649
1484
|
onChange: (e) => handleInputChange("lockoutEnabled", e.target.checked),
|
|
1650
1485
|
children: t("AbpIdentity::DisplayName:LockoutEnabled")
|
|
1651
1486
|
}
|
|
1652
|
-
),
|
|
1653
|
-
/* @__PURE__ */ jsx2(
|
|
1654
|
-
Checkbox2,
|
|
1655
|
-
{
|
|
1656
|
-
checked: formState.twoFactorEnabled,
|
|
1657
|
-
onChange: (e) => handleInputChange("twoFactorEnabled", e.target.checked),
|
|
1658
|
-
children: t("AbpIdentity::DisplayName:TwoFactorEnabled")
|
|
1659
|
-
}
|
|
1660
1487
|
)
|
|
1661
1488
|
] }) }),
|
|
1662
1489
|
/* @__PURE__ */ jsx2(Tabs.Content, { value: "roles", children: /* @__PURE__ */ jsxs2(VStack2, { gap: 2, align: "stretch", pt: 4, children: [
|
|
@@ -1722,7 +1549,6 @@ export {
|
|
|
1722
1549
|
IDENTITY_ROUTE_PATHS,
|
|
1723
1550
|
IDENTITY_ROUTE_PROVIDERS,
|
|
1724
1551
|
IdentityRoleService,
|
|
1725
|
-
IdentityService,
|
|
1726
1552
|
IdentityStateService,
|
|
1727
1553
|
IdentityUserLookupService,
|
|
1728
1554
|
IdentityUserService,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abpjs/identity",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "ABP Framework identity components for React - translated from @abp/ng.identity",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@chakra-ui/react": "^3.2.0",
|
|
27
27
|
"@emotion/react": "^11.11.0",
|
|
28
|
-
"@abpjs/core": "
|
|
29
|
-
"@abpjs/
|
|
30
|
-
"@abpjs/
|
|
28
|
+
"@abpjs/core": "4.0.0",
|
|
29
|
+
"@abpjs/theme-shared": "4.0.0",
|
|
30
|
+
"@abpjs/permission-management": "4.0.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@abp/ng.identity": "
|
|
33
|
+
"@abp/ng.identity": "4.0.0",
|
|
34
34
|
"@testing-library/jest-dom": "^6.9.1",
|
|
35
35
|
"@testing-library/react": "^14.0.0",
|
|
36
36
|
"@testing-library/user-event": "^14.6.1",
|