-
I am following a JWT authentication document, but when I check the value of the generated JWT token. I don't see the security property, which means this property is undefined.
Expect:The JWT Token generated from Does anybody help me fix this? please |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @kudos-cmd If you take a look at the source you will see the Try accessing the |
Beta Was this translation helpful? Give feedback.
Hi @kudos-cmd
If you take a look at the source you will see the
securityId
is given to theid
property in thegenerateToken
function:https://github.com/strongloop/loopback-next/blob/70f37d7cfc09db01ed5cf49c3150ce32ec16fcf2/extensions/authentication-jwt/src/services/jwt.service.ts#L54-L77
Try accessing the
id
property in this case to access the user's Id. You might also expect to see the property namedsub
to contain the user (subject) id but that is not the case here.