I have a username JSON object which is being stored in as "bootstrappedUser". It is only defined on successful login. How would I make this available to the view (embed this object into the html source code) in ejs if it is defined?
app.get('/', function(req, res) {
res.render('index.ejs',{
bootstrappedUser: req.user
});
});
You can access this in EJS via:
<div>
<%= bootstrappedUser %>
</div>