Advanced Node and Express: Registration of New Users

Hi. I’m having an issue on this challenge. I’ve set up my app.post('/register') route and am successfully creating a new user in my database. Then I authenticate the new user and attempt to redirect them to my '/profile' route. Before they can be routed to that page, you have to call ensureAuthenticated to make sure they’re logged in. Immediately prior to my res.redirect('/profile'), the user object is defined. However, once my request arrives at ensureAuthenticated, it’s undefined and my ensureAuthenticated fails. I can’t figure out why the redirect seems to be causing the user object to disappear. Thanks in advance for any help you can provide.

Whoops, found it. Was searching for id in my deserializeUser instead of _id. Ugh