I have a simple nodejs/express application by this example. In that view there is checking everyauth.loggedIn variable, but in my application I don’t use everyauth module I use the following code instead:
req.session.auth = user;
How can I get access to req.session.auth in a view in this case?
You’ll need to use a
dynamicHelperto expose anything in the session object (or the session object itself). You can do something like this in your app.js:Then in your views, you will have an
authvariable that points to the session object. For example: