@logto/core-kit 2.1.2 → 2.2.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/lib/scope.d.ts +8 -2
- package/lib/scope.js +8 -0
- package/package.json +1 -1
package/lib/scope.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare enum ReservedScope {
|
|
|
2
2
|
OpenId = "openid",
|
|
3
3
|
OfflineAccess = "offline_access"
|
|
4
4
|
}
|
|
5
|
-
export type UserClaim = 'name' | 'picture' | 'username' | 'email' | 'email_verified' | 'phone_number' | 'phone_number_verified' | 'custom_data' | 'identities';
|
|
5
|
+
export type UserClaim = 'name' | 'picture' | 'username' | 'email' | 'email_verified' | 'phone_number' | 'phone_number_verified' | 'roles' | 'custom_data' | 'identities';
|
|
6
6
|
/**
|
|
7
7
|
* Scopes for ID Token and Userinfo Endpoint.
|
|
8
8
|
*/
|
|
@@ -36,7 +36,13 @@ export declare enum UserScope {
|
|
|
36
36
|
*
|
|
37
37
|
* See {@link idTokenClaims} for mapped claims in ID Token and {@link userinfoClaims} for additional claims in Userinfo Endpoint.
|
|
38
38
|
*/
|
|
39
|
-
Identities = "identities"
|
|
39
|
+
Identities = "identities",
|
|
40
|
+
/**
|
|
41
|
+
* Scope for user's roles.
|
|
42
|
+
*
|
|
43
|
+
* See {@link idTokenClaims} for mapped claims in ID Token and {@link userinfoClaims} for additional claims in Userinfo Endpoint.
|
|
44
|
+
*/
|
|
45
|
+
Roles = "roles"
|
|
40
46
|
}
|
|
41
47
|
/**
|
|
42
48
|
* Mapped claims that ID Token includes.
|
package/lib/scope.js
CHANGED
|
@@ -38,6 +38,12 @@ export var UserScope;
|
|
|
38
38
|
* See {@link idTokenClaims} for mapped claims in ID Token and {@link userinfoClaims} for additional claims in Userinfo Endpoint.
|
|
39
39
|
*/
|
|
40
40
|
UserScope["Identities"] = "identities";
|
|
41
|
+
/**
|
|
42
|
+
* Scope for user's roles.
|
|
43
|
+
*
|
|
44
|
+
* See {@link idTokenClaims} for mapped claims in ID Token and {@link userinfoClaims} for additional claims in Userinfo Endpoint.
|
|
45
|
+
*/
|
|
46
|
+
UserScope["Roles"] = "roles";
|
|
41
47
|
})(UserScope || (UserScope = {}));
|
|
42
48
|
/**
|
|
43
49
|
* Mapped claims that ID Token includes.
|
|
@@ -46,6 +52,7 @@ export const idTokenClaims = Object.freeze({
|
|
|
46
52
|
[UserScope.Profile]: ['name', 'picture', 'username'],
|
|
47
53
|
[UserScope.Email]: ['email', 'email_verified'],
|
|
48
54
|
[UserScope.Phone]: ['phone_number', 'phone_number_verified'],
|
|
55
|
+
[UserScope.Roles]: ['roles'],
|
|
49
56
|
[UserScope.CustomData]: [],
|
|
50
57
|
[UserScope.Identities]: [],
|
|
51
58
|
});
|
|
@@ -56,6 +63,7 @@ export const userinfoClaims = Object.freeze({
|
|
|
56
63
|
[UserScope.Profile]: [],
|
|
57
64
|
[UserScope.Email]: [],
|
|
58
65
|
[UserScope.Phone]: [],
|
|
66
|
+
[UserScope.Roles]: [],
|
|
59
67
|
[UserScope.CustomData]: ['custom_data'],
|
|
60
68
|
[UserScope.Identities]: ['identities'],
|
|
61
69
|
});
|