|
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 |
Answered by
dougal83
Apr 23, 2021
Replies: 1 comment 1 reply
|
Hi @kudos-cmd If you take a look at the source you will see the Try accessing the |
1 reply
Answer selected by
alvis-do
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @kudos-cmd
If you take a look at the source you will see the
securityIdis given to theidproperty in thegenerateTokenfunction:https://github.com/strongloop/loopback-next/blob/70f37d7cfc09db01ed5cf49c3150ce32ec16fcf2/extensions/authentication-jwt/src/services/jwt.service.ts#L54-L77
Try accessing the
idproperty in this case to access the user's Id. You might also expect to see the property namedsubto contain the user (subject) id but that is not the case here.