I am creating a MEAN stack with express 4 and angular 5. I am getting a little confused about best practices when it comes to storing a users object on the browser.
So far I have successfully created the user and stored the user and its encrypted password in my mongodb using mongoose, passport and sessions. At this point I have have my user session saved with passport but I don't quite know what to do next.
Most tutorials simply return the username/email and passord (some even return unencrypted passwords!), but I think this is just for brevity. This leaves me not really knowing what I should return and how exactly I should store it using my Angular Application. So I guess my main questions is:
How do I securley store my user object and/or session on the client browser. I've seen some tutorials send a JSON Web Tokens and the user ID and store it in the localStorage, but is that necessary in my instance since I'm already using a session?
Any help is much appreciated, and any extra information will be provided, just let me know. Cheers!