Skip to content Skip to sidebar Skip to footer

Axios Data Coming Out To Be Undefined

I have a route in nodeJs which looks like this app.get('/', (req, res) => { console.log(req.user) res.json(req.user) }) Here console.log showing undefined but if I visit th

Solution 1:

You're console.logging req.user which isn't in your object, hence why it's undefined. console.log(req.userId) or console.log(req.username) and notice that it is defined


Post a Comment for "Axios Data Coming Out To Be Undefined"