userJwt decode error blocks User Report?

I add the console.log into comments.controller.js to see what happens in it because my User Report never shows result. It led me to find the message in console which I don’t know if it make sense or something. I saw the GET /api/v1/user/comment-report returned with 401. I think it’s because of having the error returned decode userJwt.

I think it might be the reason I never got the result of User Report. But I can’t recall if any ticket asking to modify something relate to jwt decode/encode or signature. Can someone please give more hint to resovle it.

You appear to be altering the comments.controller.js as I can clearly see your console.log output. You are not meant to be altering anything outside of the /dao folder for the duration of this course.

I suggest it would be best practice to restore the original code for any of the /api or /test files in case you have inadvertently made breaking changes.

Similarly a fresh install of dependencies is recommended by deleting /node_modules and running npm install ( and only npm install, do NOT run audit fix ).

Also make sure you have a valid string within the “secret” of your .env file, and most importantly that your addUser() method from the DAO is indeed passing all tests for user-management.

1 Like