Passing the request object to all templates

12 views
Skip to first unread message

Benedict Chen

unread,
Sep 21, 2015, 11:31:42 PM9/21/15
to sails.js
Hey guys,

I am using layout.ejs, which comes with Sails by default.  I added sails authentication, so the request object has a .user property.  I want to ensure that all response.view (res.view) context contains the request object, but I can't find a good way to do this that is documented.  

Any help?

Cory Robinson

unread,
Sep 22, 2015, 12:51:32 AM9/22/15
to Benedict Chen, sails.js
A good direction to look is the res.locals object which is passed to the views.
Reply all
Reply to author
Forward
0 new messages