Passport JS req.isAuthenticated() returns false when used outside req.login()
Hey guys i am using passport with react and i am using a custom callback to send the errors if any. I read that while using custom callback i have to use req.login() manually but when i use req.isAuthenticated() later i always get false. Also req.user is undefined. What should I do?
Keep getting TypeError: Cannot set properties of undefined (setting ‘user’)
I’m new to Nodejs and Express server. I’m trying to create a webapp where user can log in with their Gmail. My front-end uses Reactjs. However, I keep getting this error TypeError: Cannot set properties of undefined (setting ‘user’)
Backend says isAuthenticated is true/ frontend says isAuthenticated is false
Im using passport js google oauth20. Upon fetching from the backend and console.logging the data I get false. I’m not sure what’s causing this