I am using Passport.js for authentication, React for frontend, and Express for backend.
When my user logs in, they are successfully authenticated and the user gets logged in, but unfortunately the user info which is supposed to be sent back to my client is completed as a post request and gets rendered to the screen.
This is strange because all my other ajax requests through axios, I always get a response back to the client side, but for for this particular route it does not. Maybe it is a passport limitation? Regardless:
I am using Passport.js for authentication, React for frontend, and Express for backend.
When my user logs in, they are successfully authenticated and the user gets logged in, but unfortunately the user info which is supposed to be sent back to my client is completed as a post request and gets rendered to the screen.
This is strange because all my other ajax requests through axios, I always get a response back to the client side, but for for this particular route it does not. Maybe it is a passport limitation? Regardless:
Here is my route definition in Express:
Here is the ajax call using axios (no response is ever logged because the page ends up redirecting somehow)
How can I make it so the response is sent to my client and not rendered? Feel free to answer on SO