# Auth0 React, Node, & Passport - session.passport.user undefined

**URL:** <https://community.auth0.com/t/auth0-react-node-passport-session-passport-user-undefined/59146>\
**Category:** Get Help\
**Tags:** node, react, passport, auth0, login\
**Created:** [March 9, 2021, 10:30pm UTC](https://community.auth0.com/t/auth0-react-node-passport-session-passport-user-undefined/59146 "2021-03-09T22:30:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![blubberbo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/blubberbo/32/12857_2.png) [@blubberbo](https://community.auth0.com/u/blubberbo)\
**Post date:** [March 9, 2021, 10:30pm UTC](https://community.auth0.com/t/auth0-react-node-passport-session-passport-user-undefined/59146/1 "2021-03-09T22:30:56Z")

</div>

Hi,

I have inherited an app that I am trying to get to work and having trouble. The app uses React, Node, and Passport. My understanding of the workflow is as follows:

1. user clicks “login” in the React app
2. React calls /login/auth0 on my Node server
3. my Node server calls Auth0
4. Auth0 authenticates the user
5. Auth0 returns to my Node server using the callback url

Step 4 above works, because I am successfully redirected to the Auth0 login screen and can login.

Step 5 is where I run into the issue - I get redirected back to the server and can debug a breakpoint where it hits (in my postAuthenticationRouter.js) and I can see that `req.session.passport.user` is undefined).

I have tried some pieces of debugging and I am totally stuck. At this point, I am thinking of maybe trying to look at the req object to maybe find some clues that could indicate what is missing or going wrong. What I see of `req.session` is the following:

 ![Screenshot 2021-03-09 at 2 (1)](https://global.discourse-cdn.com/auth0/original/3X/2/5/25479230c130d5ee4822c3754249d9be57846d87.png)

Where in that object is the authenticated user’s information supposed to be?

As far as I can tell, the Auth0 part is happening correctly, since it redirects me back to my app. I am confused though, because as far as I can tell, the response from Auth0 is not coming back with anything.

Alternatively, does anyone have a tip of where I could put a breakpoint on my server to see the response coming from Auth0 to just spot check that it has the information about the user?

Thank you so much for the help! Please let me know if I can provide any other details!

---

<div class="post-metadata">

**Author:** ![blubberbo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/blubberbo/32/12857_2.png) [@blubberbo](https://community.auth0.com/u/blubberbo)\
**Post date:** [March 15, 2021, 4:58pm UTC](https://community.auth0.com/t/auth0-react-node-passport-session-passport-user-undefined/59146/2 "2021-03-15T16:58:04Z")

</div>

The issue here ended up being my version of Node.js was 10.x and the one from the origin machine was 14.x. Once I updated the version of Node on my machine, this worked!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 25, 2021, 10:01am UTC](https://community.auth0.com/t/auth0-react-node-passport-session-passport-user-undefined/59146/3 "2021-03-25T10:01:11Z")

</div>

Perfect glad to hear that and thanks for sharing with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 25, 2021, 10:01am UTC](https://community.auth0.com/t/auth0-react-node-passport-session-passport-user-undefined/59146/4 "2021-03-25T10:01:14Z")

</div>


