mongodb / stitch-js-sdk

MongoDB Stitch JavaScript SDK
Apache License 2.0
113 stars 67 forks source link

Custom JWT metadata fields missing on StitchUserProfile type #409

Closed rvanmil closed 1 year ago

rvanmil commented 4 years ago

The user object has a data property on its profile which contains the metadata fields we have defined in the custom JWT authentication settings. This data property can only be accessed if we ignore the StitchUser type of the user object and treat it as any instead. Looking at the source it seems there is a difference between the user object at runtime. The profile property is specified as readonly profile: StitchUserProfile but when debugging it is of the type ApiCoreUserProfile.

stitchuser1 stitchuser2