Currently, I am working on developing an Express.js application that utilizes Passport.js for authentication in an administration panel. The program is functioning correctly at the moment, with my app.js initializing passport and setting up sessions properly. All routes are set up in a separate file within my routes folder.
However, I am encountering an issue in my IDE (Jetbrain's IntelliJ Idea/WebStorm) where it shows an "Unresolved variable user" error when I attempt to access "req.user" in my index.js file.
https://i.stack.imgur.com/SddFd.png
In addition, I am also seeing a similar error in my index.ejs file.
https://i.stack.imgur.com/IksZ7.png
Despite these errors, the "req.user" variable does contain data and allows me to verify its existence and display relevant information when the user is logged in.
In my app.js file, I do not receive any unknown variable errors when accessing "req.user", which leads me to believe that there may be an issue with how I have set up my routes.
Any assistance would be greatly appreciated. Thank you.