title: How to Request User Data after Logged In, Node.JS
body: <p>Hello guys I'm new to Node so please bear with me.</p>
  
  <p>Anyway I am currently working on authentication for my new Node app. So far I was capable of getting everything basic working (login, register, logout). I am now entering the settings page of my user profile but I cannot access {{username}} or {{email}} for example, it either stays blank or throws back an error.</p>
  
  <p>I was wondering how I can make the username, email and other info stay in the session or able to access it once my user is logged in, and how I can add more information to the session later (this is important as I will need to do it).</p>
  
  <p>Here is my code:</p>
  
  <p>Registration (not including verification)</p>
  
  <pre><code>    var newUser = new User({
              username: username,
              email:email,
              password: password
          });
  
  User.createUser(newUser, function(err, user){
              if(err) throw err;
              console.log(user);
              req.flash('success_msg', 'You are registered and can now login');
  </code></pre>
  
  <p>Login:</p>
  
  <pre><code>router.post('/login',
    passport.authenticate('local', {successRedirect:'/', failureRedirect:'/users/login',failureFlash: true}),
    function(req, res) {
      res.redirect('/');
    });
  </code></pre>
  
  <p>I'm not sure exactly what code I need to show but if you guys need to see anything else to help me please let me know.</p>
  
  <p>I'm using Node.JS with express, passport and handlebars.</p>
  
  <p>Thank you!</p>