I am getting the following error in Express when attempting to validate the permissions of an incoming request with JWT:
UnauthorizedError: user object “user” was not found. Check your configuration
I am using express-jwt to verifiy the incoming JWT. This seems to be working. However for checking the token’s permissions, I am using express-jwt-permissions, which according to the documentation is supposed to work with express-jwt, exactly as I am doing, but I keep getting that error.
I decoded my token using jwt.io and I indeed have no “user” object inside the payload. However I was left with the impression that this is not a problem, because express-jwt should set decode and create the object inside the request ( I am not sure about this part though).
Is this a problem of the library(ies) handling the token verification, with my configuration or something with the token itself (even though it is valid)?
Configuration: