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.
The user object has a
data
property on itsprofile
which contains the metadata fields we have defined in the custom JWT authentication settings. Thisdata
property can only be accessed if we ignore theStitchUser
type of the user object and treat it asany
instead. Looking at the source it seems there is a difference between the user object at runtime. Theprofile
property is specified asreadonly profile: StitchUserProfile
but when debugging it is of the typeApiCoreUserProfile
.