Hi guys, I have been stuck on this issue for some days now, and I have tried everything to get it to work with no avail, and I am hoping to receive the help I need.
I am trying to protect certain API’s in my application by using jwt’s, and I keep running into the problem below whenever I test out the protected route in postman
Hi, I did that and the problem still persists
I am basically trying to authenticate a user token, return that user, and retrieve a list of ‘talks’ from the database
mongoose adds _id of type ObjectId since there’s not one defined in the Schema. If you are not passing _id in request body from Postman then you shouldn’t be seeing that error. Could you please step through the service code to see where exactly the exception is being thrown?
hey…so the issue is not with the authorize method. The issue is with the route for some weird reason. I found out that when I use this “/” route in Postman, it collects the data just fine. When I write anything after the slash like “/talks” it throws the same error again. Why do you think that may be? I mean this is a standard get API call, I shouldn’t be having such difficulty getting data