Usage
var back = require('virus-back');
app.use(session({
secret: 'Session Secret'
}));
app.use(back());
app.get('/test', function(req, res) {
if (!req.isAuthenticated()) {
return res.back();
}
});
API
var back = require('virus-back');
This middleware depends upon a session middleware or req.session
, and will populate req.prevPath
and req.prevPrevPath
.
back(options)
- options
- options.default The fallback path to populate req.prevPath and req.prevPrevPath, defaults to '/'