Apologies if this is a silly question, I have been passing JSON db collection objects to my EJS template code in a Node.js POST request with res.render("login", {var: object});
and am only using some of the contents of each (escaped) for my templates.
Just to confirm, is it only the final rendered contents of the template that is returned to the client or does the entire object get passed back?
example:
App.js
Company.find({companyCode: "12345"}, function(err, foundCompany){
if(err){ console.log(err); }
res.render('/login', {foundCompany: foundCompany});
Login.ejs
<p> The Company is: <%= foundCompany.name %> </p>
From a security point of view, if "foundCompany" contained alot more information I did not particularly want the user finding a way to access, is this all sent to the client on render or is it only the escaped values used which have been manipulated by the back end template engine?