logto-io / js

🤓 Logto JS SDKs.
https://docs.logto.io/quick-starts/
MIT License
61 stars 40 forks source link

bug: missing `organization_data` definition in `IdTokenClaims` #758

Closed SamSalvatico closed 2 months ago

SamSalvatico commented 2 months ago

Describe the bug

I noticed that in logto-io/js , in the IdTokenClaims definition (https://github.com/logto-io/js/blob/75289f3d01b3aa0c35383585b2adc4e5461bafb0/packages/js/src/utils/id-token.ts#L7) the organization_data array is missing but is returning when asking for user info

Expected behavior

organization_data is available in the IdTokenClaims type

How to reproduce?

Invoke the getLogtoContext method with fetchUserInfo set to true If an organisation role is assigned the organisation_data will be returned, but it is missing in the type definition

Context

Screenshots

charIeszhao commented 2 months ago

Thanks for reporting. The issue is actually with UserInfoResponse type, not with IdTokenClaims, though. Since we need to consider the token size, some claims that are available in UserInfoResponse are not available in IdTokenClaims.