I have a login form. When an incorrect password is provided, the route will use req.flash
to add an error message to the session.
I need to access this error message in my template for display. I am wondering if the flash
is automatically passed to the view by Express, or do I need to add this to the render myself?
You need to pass it, but here's a nice article which makes it quite simple using a dynamic helper:
http://www.stehem.net/2012/01/15/how-to-use-the-flash-with-express.html