Skip to content
Advertisement

User ID won’t save into session after a log in

I’m new to coding and I’m trying to write one of my first apps. I encountered a problem with my log in function. The user id saves into my session object after user registration but it won’t save into it after a log in. I’m using MongoDB. Here is the code:

Controller

JavaScript

Model

JavaScript

Screenshot of the console – registration

Screenshot of mongo – registration

Screenshot of the console – log in

Screenshot of mongo – log in

I’ve been following Brad Schiffs Java Script Full Stack from Scratch course and everything seems to be working fine for him.

Advertisement

Answer

Your model does nothing with found user: try

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement