Hey team, Im trying to wrap custom attributes to t...
# support-questions
m
Hey team, Im trying to wrap custom attributes to the jwt priovided by supertokens. Im using Node (backend) and angular js (frontend). I went through the docs, but not sure as to where I will be calling the '/updateinfo' endpoint mentioned in the docs -> https://supertokens.com/docs/passwordless/common-customizations/sessions/with-jwt/custom-claims#method-1-after-session-verification. Please clarify.
r
Hey @mukulg22
If you want to add custom attributes during session creation, you can do that by overriding the createNewSession function
As shown in the first part of the link above
m
Hey @rp, in the example I see that the role set is static value in createNewSession method. How do I pass dynamic values in this case?
r
you can write your own code in the function to get any attribute dynamically. It's just a regular function
m
meanwhile, how do I get the user email in this method? I dont find it in the accessToken @rp
r
you can get the user ID and then get the user info from the recipe function (i think there should be a getUserById function), and then add that into the access token payload