-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
version new jsonwebtoken error #403
Comments
We have changed the validators used for the We use lodash now, take a look to this function: https://lodash.com/docs/4.17.4#isPlainObject Anyway I think we should communicate better that error, it could say something like "expected payload object to be a plain object" or similar. Can you share the content of |
@ziluvatar : I've added a PR to change the wording. |
PR was merged. It's on v8.1.0 |
Can this be fixed by simply adding |
You can try |
@kedrovski or @UNADYNE solution works fine but i suggest you to use: You could have to pass diferent "doc" objects, one returned from mongoose and another defined by you like this:
If you use |
wont there be a performance issue using json stringify with json parse ? but yeah toJSON() or toObject() both comes as undefined on the object |
I use the new version with the error occurred "jsonwebtoken": "^8.0.1",.
I use the old version the bug has been removed "jsonwebtoken": "^7.4.3".
MESSAGE ERROR ==>
events.js:160
throw er; // Unhandled 'error' event
^
Error: Expected object
at validate (E:\App\code\node_modules\jsonwebtoken\sign.js:34:11)
at Object.module.exports [as sign] (E:\App\code\node_modules\jsonwebtoken\sign.js:100:7)
at E:\App\code\dist\app.js:402:37
at Query. (E:\App\code\node_modules\mongoose\lib\model.js:3841:16)
at E:\App\code\node_modules\kareem\index.js:273:21
at E:\App\code\node_modules\kareem\index.js:131:16
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
The text was updated successfully, but these errors were encountered: