I need to get user data from JWT token and display it on index.ejs for logged in users. I am getting the following error when trying to redirect the user to /posts after user logs in :
ReferenceError: Cannot access ‘token’ before initialization
I think the issue lays in routes/auth.js (line 75) but I am not quite sure how to fix it.
Thanks in advance.
Github repo :